[JW Lua] SetMeasurement

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Sun Apr 26 12:31:19 CEST 2015


Chris,

Yes, the comma needs to be supported as a decimal separator for numbers 
as well. I'll look into it.

However, for input dialogs you don't need to convert measurements 
manually, unless you want a specific input measurement. Instead, use the 
"Measurement" input type. This script would do basically the same thing:

---
local dialog = finenv.UserValueInput()
dialog.Title = "Test"
dialog:SetTypes("Measurement")
dialog:SetDescriptions("Variable")

local varEVPU = 200
dialog:SetInitValues(varEVPU)

returnValues = dialog:Execute()
if not returnValues then return false end
print(returnValues[1])
---


Best regards,

Jari Williamsson


On 2015-04-23 16:29, Chris wrote:
> Hello Jari
>
> I have a problem with this script.
> The return value is a integer (1  instead of 1.76388)
> Is it a problem of international decimal symbol ?
>
> (sorry for my english)
>
> ---------------------------------
> function EVPUtoCm(value)
>      local string = finale.FCString()
>      string:SetMeasurement(value, finale.MEASUREMENTUNIT_CENTIMETERS)
>      return string.LuaString
> end
>
> local dialog = finenv.UserValueInput()
> dialog.Title = "Test"
> dialog:SetTypes("Number")
> dialog:SetDescriptions("Variable")
>
> local varEVPU = 200
> local varCm = EVPUtoCm(varEVPU)
> print(varCm)
> dialog:SetInitValues(varCm)
>
> returnValues = dialog:Execute()
> if not returnValues then return false end
> print(returnValues[1])
> ---------------------------------
>
>
> Best regards
>
> Chris
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>






More information about the JWLua mailing list