[JW Lua] Using the input dia;og

Charles O. Lawrence charlesolawrence at bellsouth.net
Tue Sep 3 00:54:15 CEST 2013


Jari,

 

I hate to keep bothering you, but the below script seems to ignore the 3rd
and 4th checkboxes.  They are initialized to true, but always show as false,
no matter how they are checked.  Am I missing something?

 

Are there other properties or methods for the finenv namespace?

Are there other properties or methods for finale:FCUI?  You mentioned the
Beep().

 

Charles Lawrence

 

 

 

-- use a user input dialog to gather user input

local dialog = finenv.UserValueInput()

dialog.Title = "Checkboxes"

dialog:SetTypes("Boolean","Boolean","Boolean","Boolean")

dialog:SetDescriptions("Layer 1","Layer 2","Layer 3","Layer 4")

dialog:SetInitValues(true,true,true,true)

local returnvalues = dialog:Execute()

if not returnvalues then return end

 

-- use a table to hold the boolean values for each layer

useLayer = {}

useLayer[1] = returnvalues[1]

useLayer[2] = returnvalues[2]

useLayer[3] = returnvalues[3]

useLayer[4] = returnvalues[4]

 

print (returnvalues[1],returnvalues[2],returnvalues[3],returnvalues[4])

 

-- check that at least two layers are selected

layerCount = 0

for k,v in pairs(useLayer) do

    print (k,v)

    if v then layerCount = layerCount + 1 else end

end

 

print ("Number of layers selected =",layerCount)

 

 

printout

 

true true false false

1 true

2 true

3 false

4 false

Number of layers selected = 2

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20130902/2725daf2/attachment-0002.html>


More information about the JWLua mailing list