[Gambas-user] Bug / changed behaviour of Input

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


> Lol, there is a LOT of usage for scanf :)
>

Yes, I'm sure it has (it's on stdio).
I just haven't need it.



> If we say c++ istream instead, then you have cin >> a >> b >> ...
> If I want to read a text file word by word, (where a word is something
> whitespace-separated, space on newline), cin >> is quite easy to use.
> Gambas Input works about in the same way, but the Val thing can in some
> cases be strange so you don't know what you really get. There is Line Input
> which always gives a string, but it only separates on newline, not any
> whitespace.
>

So, maybe Input should be without Val kind of feature, then it could be
used to safely parse txt files, etc.
In my opinion syntax s = Input As String, i = Input As Integer, etc doesn't
make it useful.
If you know when there is string and when integer, then you should use Read
instead.

Maybe Input could have optional argument to switch on/off interpretation of
read values...

Jussi



More information about the User mailing list