<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body alink="#EE0000" link="#0B6CDA" text="#000000" vlink="#551A8B">
    <div class="moz-cite-prefix">Hello Osvaldo,<br>
      <br>
      Yes, there are awful sticky bugs on input(). Despite it is a
      "basic" function, it has never ever worked in a completely right
      way. It is a quite nasty situation for a high level language to
      have such a pitfall on basics.<br>
      IMO, curing it once and for all should be in the top-10 priorities
      for Scilab 6.0.1.<br>
      <br>
      Let's have a look to input() behavior versus Scilab's versions:<br>
      <b><tt>4.0 - 4.1.2:</tt></b><tt><br>
      </tt><tt>-->mprintf("head of line"); mprintf(" without ending
        newline");<br>
        head of line without ending newline<br>
        -->mprintf("head of line"); s=input("Message: ","s")<br>
        head of lineMessage: <b><font color="#cc0000">--></font></b>myAnswer    
        <font color="#cc0000">// no way to forget that we are prompted..
          :/</font><br>
         s  =<br>
         myAnswer<br>
      </tt><tt><br>
        <b>5.1.0, 5.2.0, 5.3.0:</b><br>
        -->mprintf("head of line"); mprintf(" without ending
        newline");<br>
        head of line without ending newline<br>
                             <font color="#cc0000">// this blank line
          is displayed only from Scilab 5.3.0 on</font><br>
        -->mprintf("head of line"); s=input("Message: ","s")<br>
        head of line         <font color="#cc0000">// why this newline?</font><br>
        Message:myAnswer     <font color="#cc0000">// eaten space after
          ":" when prompting<br>
        </font> s  =<br>
         myAnswer   <br>
        <br>
      </tt><tt><b>5.4.0, 5.5.0 - 5.5.2:</b><br>
      </tt><tt>-->mprintf("head of line"); mprintf(" without ending
        newline");</tt><tt><br>
      </tt><tt>head of line without ending newline </tt><tt><br>
      </tt><tt>-->mprintf("head of line"); s=input("Message: ","s")</tt><tt><br>
      </tt><tt>head of line</tt><tt><font color="#cc0000">         //
          but still: why this appended newline?<br>
        </font></tt><tt>Message: myAnswer</tt><tt>    <font
          color="#33cc00">// now the space is correctly displayed when
          prompting</font><br>
      </tt><tt> s  = </tt><tt><br>
      </tt><tt> myAnswer   </tt><tt><br>
      </tt><br>
      <b><tt>6.0.0</tt></b>:  the worst, as you described it and as it
      is already reported in Bugzilla.<br>
      <a class="moz-txt-link-freetext" href="http://bugzilla.scilab.org/14376">http://bugzilla.scilab.org/14376</a><br>
      <a class="moz-txt-link-freetext" href="http://bugzilla.scilab.org/14424">http://bugzilla.scilab.org/14424</a><br>
      <br>
      I did not find any workaround.. Same issue with mscanf():
      <a class="moz-txt-link-freetext" href="http://bugzilla.scilab.org/14998">http://bugzilla.scilab.org/14998</a><br>
      <br>
      Any idea for a workaround?<br>
      <br>
      Regards<br>
      Samuel<br>
      <br>
      Le 03/03/2017 à 15:20, Osvaldo Sergio Farhat de Carvalho a écrit :<br>
    </div>
    <blockquote
cite="mid:OFCB32A2AF.B7356BA9-ON832580D8.004EBE83-832580D8.004EBE86@grude.ufmg.br"
      type="cite"><font face="Default Sans
        Serif,Verdana,Arial,Helvetica,sans-serif" size="2">Hello,<br>
        I was trying some simple programs that use the input statement
        on Scilab 6.0.0, and I got unexpected behaviour. Here is a test:
        <pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><font color="#000000">n</font> <font color="#5c5c5c">=</font> <font color="#000000">input</font><font color="#4a55db">(</font><font color="#bc8f8f">"</font><font color="#bc8f8f">n = </font><font color="#bc8f8f">"</font><font color="#4a55db">)</font>
<font color="#a020f0">while</font> <font color="#000000">n</font> <font color="#5c5c5c">></font> <font color="#bc8f8f">0</font>
    <font color="#000000">n</font> <font color="#5c5c5c">=</font> <font color="#000000">input</font><font color="#4a55db">(</font><font color="#bc8f8f">"</font><font color="#bc8f8f">n = </font><font color="#bc8f8f">"</font><font color="#4a55db">)</font>
<font color="#a020f0">end</font>
<font color="#32b9b9">printf</font><font color="#4a55db">(</font><font color="#bc8f8f">"</font><font color="#bc8f8f">\nThanks</font><font color="#bc8f8f">"</font><font color="#4a55db">)</font></pre>
        <br>
        Here is the result of this program on Scilab 6.0.0 console with
        input 1, 2, 3, 4 and 0:<br>
        <font face="Default Monospace,Courier New,Courier,monospace"><br>
          n = <br>
          1<br>
          <br>
          n = <br>
          --> 2<br>
          n = <br>
          3<br>
          <br>
          n = <br>
          4<br>
          <br>
          n = <br>
          0<br>
          <br>
          <br>
          Thanks<br>
          2+2<br>
           ans  =<br>
          <br>
             4.</font><br>
        <br>
        Compare this with the output on Scilab 5.5.2 console for the
        same input:<br>
        <br>
        <font face="Default Monospace,Courier New,Courier,monospace">n =
          1<br>
          n = 2<br>
          n = 3<br>
          n = 4<br>
          n = 0<br>
          <br>
          Thanks</font> <br>
        <br>
        This is much more what one should expect from this litle
        program. Remark that on 6.0.0 console<br>
        1) There is a disturbing new line after printing the input
        statement message<br>
        2) There is a spurious apearance of the console prompt "-->"
        after the first execution of input statement<br>
        3) The console prompt "-->" does not appear after the end of
        program execution.<br>
        <br>
        I am using Scilab on a Windows 10 system.<br>
        <br>
        Thanks for your attention.<br>
        Osvaldo<br>
        <br>
        <pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><font color="#000000">
</font></pre>
      </font>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>