[Scilab-users] Once and for all curing input() : a good target for Scilab 6.0.1 <== Re: Bug in input statement

Samuel Gougeon sgougeon at free.fr
Fri Mar 3 21:06:54 CET 2017


Hello Osvaldo,

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.
IMO, curing it once and for all should be in the top-10 priorities for 
Scilab 6.0.1.

Let's have a look to input() behavior versus Scilab's versions:
*4.0 - 4.1.2:*
-->mprintf("head of line"); mprintf(" without ending newline");
head of line without ending newline
-->mprintf("head of line"); s=input("Message: ","s")
head of lineMessage: *-->*myAnswer // no way to forget that we are 
prompted.. :/
  s  =
  myAnswer

*5.1.0, 5.2.0, 5.3.0:*
-->mprintf("head of line"); mprintf(" without ending newline");
head of line without ending newline
// this blank line is displayed only from Scilab 5.3.0 on
-->mprintf("head of line"); s=input("Message: ","s")
head of line // why this newline?
Message:myAnswer // eaten space after ":" when prompting
  s  =
  myAnswer

*5.4.0, 5.5.0 - 5.5.2:*
-->mprintf("head of line"); mprintf(" without ending newline");
head of line without ending newline
-->mprintf("head of line"); s=input("Message: ","s")
head of line         // but still: why this appended newline?
Message: myAnswer// now the space is correctly displayed when prompting
  s  =
  myAnswer

*6.0.0*:  the worst, as you described it and as it is already reported 
in Bugzilla.
http://bugzilla.scilab.org/14376
http://bugzilla.scilab.org/14424

I did not find any workaround.. Same issue with mscanf(): 
http://bugzilla.scilab.org/14998

Any idea for a workaround?

Regards
Samuel

Le 03/03/2017 à 15:20, Osvaldo Sergio Farhat de Carvalho a écrit :
> Hello,
> 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:
> n  =  input("n = ")
> while  n  >  0
>      n  =  input("n = ")
> end
> printf("\nThanks")
>
> Here is the result of this program on Scilab 6.0.0 console with input 
> 1, 2, 3, 4 and 0:
>
> n =
> 1
>
> n =
> --> 2
> n =
> 3
>
> n =
> 4
>
> n =
> 0
>
>
> Thanks
> 2+2
>  ans  =
>
>    4.
>
> Compare this with the output on Scilab 5.5.2 console for the same input:
>
> n = 1
> n = 2
> n = 3
> n = 4
> n = 0
>
> Thanks
>
> This is much more what one should expect from this litle program. 
> Remark that on 6.0.0 console
> 1) There is a disturbing new line after printing the input statement 
> message
> 2) There is a spurious apearance of the console prompt "-->" after the 
> first execution of input statement
> 3) The console prompt "-->" does not appear after the end of program 
> execution.
>
> I am using Scilab on a Windows 10 system.
>
> Thanks for your attention.
> Osvaldo
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170303/9476df41/attachment.htm>


More information about the users mailing list