<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Probably this is due to a change in Lua 5.3:<br>
    the chapter on integer/float conversion is new (
    <a class="moz-txt-link-freetext" href="http://www.lua.org/manual/5.3/manual.html#3.4.3">http://www.lua.org/manual/5.3/manual.html#3.4.3</a> ) and didn't exist
    for Lua 5.2.<br>
    It states: <br>
    <span style="color: rgb(0, 0, 0); font-family: Helvetica, Arial,
      sans-serif; font-size: medium; font-style: normal; font-variant:
      normal; font-weight: normal; letter-spacing: normal; line-height:
      20px; orphans: auto; text-align: justify; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 1;
      word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline
      !important; float: none; background-color: rgb(255, 255, 255);">"The
      conversion from float to integer checks whether the float has an <b>exact
      </b>representation as an integer (that is, the float has an
      integral value and it is in the range of integer representation).
      If it does, that representation is the result. Otherwise, the
      conversion <b>fails</b>."<br>
      <br>
      Lesson learned: <br>
      <b>Don't assign float types to properties that expect integers in
        Lua 5.3.</b> <b><br>
        They will not be automatically converted to integers anymore.</b><br>
      <br>
    </span><span style="color: rgb(0, 0, 0); font-family: Helvetica,
      Arial, sans-serif; font-size: medium; font-style: normal;
      font-variant: normal; font-weight: normal; letter-spacing: normal;
      line-height: 20px; orphans: auto; text-align: justify;
      text-indent: 0px; text-transform: none; white-space: normal;
      widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      display: inline !important; float: none; background-color:
      rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);
        font-family: Helvetica, Arial, sans-serif; font-size: medium;
        font-style: normal; font-variant: normal; font-weight: normal;
        letter-spacing: normal; line-height: 20px; orphans: auto;
        text-align: justify; text-indent: 0px; text-transform: none;
        white-space: normal; widows: 1; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; display: inline !important;
        float: none; background-color: rgb(255, 255, 255);">This
        document gives a good overview of the new integer/float handling
        in Lua 5.3:<br>
        <a class="moz-txt-link-freetext" href="http://www.lua.org/wshop14/Ierusalimschy.pdf">http://www.lua.org/wshop14/Ierusalimschy.pdf</a></span><br>
      <br>
    </span>So it seems that I will have a lot of fails now...<br>
    Bad luck then ... at least it leads to a cleaner code in the end.<br>
    <br>
    Jan<br>
    <br>
    <div class="moz-cite-prefix">Am 10.11.2015 um 11:08 schrieb Jan
      Angermüller:<br>
    </div>
    <blockquote cite="mid:5641C220.5060403@angermueller.com" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      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 moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:JWLua@jwmusic.nu">JWLua@jwmusic.nu</a>
<a moz-do-not-send="true" 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>
      <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>