[Gambas-user] Bug / changed behaviour of Input

Jussi Lahtinen jussi.lahtinen at ...626...
Wed Mar 14 17:40:07 CET 2012


> Input never returns something with spaces in it. It works about the same
> way as scanf("%s", ...), scanf("%d", ...). It splits up the input on white
> spaces.
>

Oh yes, of course.
And apparently CDate() writes "16/05/2002 00:00:00", and "00:00:00" is
interpreted as null.


I think Input is kind of wierd when it uses Val.
> If I write
>
> Dim s As String
> Input s
> Print s
>
> Then I might expect that I always get the string raw.
> Now I get this:
> "3-2" -> "03/02/2012"
> "3,2" -> "3.2"
> "True" -> "T"
> "False" -> ""
> "Yeah" -> "Yeah"
>
> Since you probably know what kind of data that is to be read (instead of
> Input guesses depending of the input string), it would be better to have
> some syntax like "s = Input As String", "s = Input As Integer" like the
> Read statement, but that it parses the string instead of just taking the
> binary bytes. Throw an error if the string could not be parsed.
>
> This parsing might be different from normal string conversion (just like
> Val). For example, input "False" really returns False and not True if you
> wanted a boolean...
>
> What do you think?
>

I don't quite get what is point of input when reading from file... What
would be the advantage to command Read?

Jussi



More information about the User mailing list