[JW Lua] Using the 'Optional' code field in RGP Lua

Robert Patterson robert at robertgpatterson.com
Wed Feb 2 22:38:00 CET 2022


This may also work in your script instead of the if statement. Not sure.
But if it does I'd like to know.

tacet_text = tacet_text or "TACET"



On Wed, Feb 2, 2022 at 3:21 PM Robert Patterson <robert at robertgpatterson.com>
wrote:

> I don't think you need a local variable at all. In your script write
>
> if tacet_text == nil then
>    tacet_text = "TACET'
> end
>
> In your prefix write:
>
> tacet_text = "IT WORKS!"
>
>
> On Wed, Feb 2, 2022 at 2:02 PM Jacob Winkler <jacob.winkler at mac.com>
> wrote:
>
>> Hey folks, and by folks I may mean mostly Robert Patterson, can anyone
>> offer some advice on how to use the new 'Optional' field in RGP Lua? It
>> seems like the perfect place for a user to store their own custom
>> variables, but I'm having a little difficulty with it.
>>
>> In the screenshot below, you can see that I am successfully setting up my
>> 'user variable'. However, I want the script to not RELY on the presence of
>> the user variable, I want it to work no matter what. To that end, I set up
>> an if/then that tests to see if my user variable is nil. If it is not nil,
>> then the script will use its value. If it IS nil, then it will use another
>> value that I have hard coded. Seems like it should work... But it doesn't.
>>
>>
>> Any suggestions on how this could be set up better?
>>
>> -Jake
>> _______________________________________________
>> JWLua mailing list
>> JWLua at jwmusic.nu
>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220202/62b72070/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 64736 bytes
Desc: not available
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220202/62b72070/attachment-0001.png>


More information about the JWLua mailing list