[JW Lua] PageFormatPrefs.SystemStaffHeight error: bad argument #2 to '?' (number has no integer representation)

Bruce Olson Finale at web.yosound.com
Mon Nov 9 06:38:01 CET 2015


Jari,

 

Ahh, found it, I need to apply a little math.floor(<floating point division
stuff>) to convert the number to an integer.

 

 

-- 

Regards,

Bruce

 

From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of Bruce Olson
Sent: Sunday, November 08, 2015 3:48 PM
To: 'The JW Lua script plug-in.'
Subject: [JW Lua] PageFormatPrefs.SystemStaffHeight error: bad argument #2
to '?' (number has no integer representation)

 

Jari,

 

I get the error using the following code:

    scorePageFormatPrefs.SystemStaffHeight = (16 * (((scoreheight - 288 -
216 - 72 - 180 - 72 - 108) / StavesSpan)) * 96)

 

Placing the following before the call:

    if DEBUG then print ("scorePrefs SystemStaffHeight, in EVPUs:", (16 *
(((scoreheight - 288 - 216 - 72 - 180 - 72 - 108) / StavesSpan)) *
96),",",(((scoreheight - 288 - 216 - 72 - 180 - 72 - 108) / StavesSpan)) *
96) end

 

gives:

scorePrefs SystemStaffHeight, in EVPUs: 890.01869158879 , 55.626168224299

 

This used to work in versions prior to 0.40, and am currently running 0.42
on Windows.

 

I don't recall that we have any type conversion functions. Is that need
here? How do we change a float to an integer? 

 

 

-- 

Regards,

Bruce

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20151108/c33eb9e4/attachment.htm>


More information about the JWLua mailing list