<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Jari,<br>
<br>
I am trying to make my scripts compatible with v.40/v.42 and get
lots of bad argument errors as Charles described some days ago
("Strange Error Message"-thread), although with different
descriptions, for example:<br>
bad argument #2 to '?' (number has no integer representation)<br>
And in my case<b> these errors have not occured when running the
scripts in previous versions of JW Lua.</b><br>
<br>
For example:<br>
(a is an FCArticulationDef)<br>
a.MainHandleVerticalOffset=a.MainHandleVerticalOffset+vertoffset
<br>
It used to work fine for any vertoffset value, even with vertoffset
being a float type.<br>
Now it throws the error message above WITHOUT the code line and
requires an explicit integer conversion to work:<br>
a.MainHandleVerticalOffset=a.MainHandleVerticalOffset+math.floor(vertoffset)<br>
<br>
Although the error message is technically correct (a float is not an
integer), the automatic type conversion used to work fine.<br>
That will be probably be days of work to fix in more than 30.000
lines of code if you have to track down every error without a
debugger.<br>
<br>
What's the reason for the new error message ? Is it a stricter
parser or Lua 5.3 or anything else ?<br>
Do you see any chance of solving that without having to rewrite all
the code.<br>
Or at least add the code line when a "Bad Argument" error is thrown
? <br>
<br>
All the best,<br>
Jan<br>
<br>
<div class="moz-cite-prefix">Am 28.10.2015 um 22:40 schrieb Charles
O. Lawrence:<br>
</div>
<blockquote cite="mid:004701d111c9$44424ef0$ccc6ecd0$@bellsouth.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Jari,<o:p></o:p></p>
<p class="MsoNormal">Sometimes when running a script I get an
error message like this. There is no line number nor is there
a red marker at any source line. It makes locating the
problem rather difficult in a large script. Any ideas? Beta
0.42<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">bad argument #2 to '?' (number expected,
got boolean)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,Charles<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Sorry, I left off the subject<o:p></o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
JWLua mailing list
<a class="moz-txt-link-abbreviated" href="mailto:JWLua@jwmusic.nu">JWLua@jwmusic.nu</a>
<a class="moz-txt-link-freetext" href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a>
</pre>
</blockquote>
<br>
</body>
</html>