[Gambas-user] Bug / changed behaviour of Input

Emil Lenngren emil.lenngren at ...626...
Wed Mar 14 18:51:04 CET 2012


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

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.

/Emil


2012/3/14 Jussi Lahtinen <jussi.lahtinen at ...626...>

> > Read reads data in binary format. Input reads data in text format.
> >
>
> I know what you mean, I just don't know usage for it.
>
>
>
> > Currently I find no way in Gambas to do the C equivalent of scanf("%s",
> > str);
> >
>
> Well... I don't see much usage for scanf() either. You still need to
> validate the input.
> If you do scanf for example hex, you can still give input which is not in
> hex format and scanf will happily accept it (and do weird things with it).
>
> So, you can as well read it as raw binary and handle it as needed.
>
> But maybe this is just due my limited knowledge.
>
> Jussi
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list