[Gambas-user] Bug / changed behaviour of Input

Emil Lenngren emil.lenngren at ...626...
Wed Mar 14 17:52:14 CET 2012


Read reads data in binary format. Input reads data in text format.
Currently I find no way in Gambas to do the C equivalent of scanf("%s",
str);

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

> > 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
>
> ------------------------------------------------------------------------------
> 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