Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-16 Thread Emil Lenngren
It is good for me :) I like to read strings in that input format. 2012/3/16 Jussi Lahtinen > > Is INPUT more useful now? I don't know, I still never use this > instruction! > > > > Same problem, I haven't use it. But now I can think usage for it. > > Would be nice to have opinions from other peo

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-16 Thread Jussi Lahtinen
> Is INPUT more useful now? I don't know, I still never use this instruction! > Same problem, I haven't use it. But now I can think usage for it. Would be nice to have opinions from other people. Anyone..? Jussi -- This

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-16 Thread Benoît Minisini
Le 15/03/2012 14:05, Jussi Lahtinen a écrit : > I think PRINT should use CStr... but I wonder how many applications this > would broke. > Though, I think that is easy to fix if it happens... > > Jussi > PRINT will keep using Str$() - I don't want to break every Gambas application. But now INPUT

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-16 Thread Benoît Minisini
Le 15/03/2012 14:05, Jussi Lahtinen a écrit : > I think PRINT should use CStr... but I wonder how many applications this > would broke. > Though, I think that is easy to fix if it happens... > > Jussi > PRINT will keep using Str$() - I don't want to break every Gambas application. But now INPUT

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-15 Thread Jussi Lahtinen
I think PRINT should use CStr... but I wonder how many applications this would broke. Though, I think that is easy to fix if it happens... Jussi 2012/3/15 Benoît Minisini > Le 15/03/2012 00:30, Emil Lenngren a écrit : > > Yeah :) > > > > Sorry, now I remember why I did that : INPUT should do

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-15 Thread Benoît Minisini
Le 15/03/2012 00:30, Emil Lenngren a écrit : > Yeah :) > Sorry, now I remember why I did that : INPUT should do the contrary of PRINT. As PRINT uses Str() to print data, INPUT should use Val() to read it. But maybe it's better to be useful than logical? -- Benoît Minisini

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Emil Lenngren
Yeah :) 2012/3/15 Benoît Minisini > Le 14/03/2012 19:46, Jussi Lahtinen a écrit : > >> That's the difference, If you pass the string "1234" to Read As Integer, > >> you get the Integer 875770417, because "1234" is in ascii 49 50 51 52, > and > >> 49 + 50*(2^8) + 51*(2^16) + 52*(2^24) = 875770417

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Benoît Minisini
Le 14/03/2012 19:46, Jussi Lahtinen a écrit : >> That's the difference, If you pass the string "1234" to Read As Integer, >> you get the Integer 875770417, because "1234" is in ascii 49 50 51 52, and >> 49 + 50*(2^8) + 51*(2^16) + 52*(2^24) = 875770417. >> > > True. I'm slow today. Maybe it's my fe

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Jussi Lahtinen
> That's the difference, If you pass the string "1234" to Read As Integer, > you get the Integer 875770417, because "1234" is in ascii 49 50 51 52, and > 49 + 50*(2^8) + 51*(2^16) + 52*(2^24) = 875770417. > True. I'm slow today. Maybe it's my fever, but I just can't lay down doing nothing. Makes m

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Emil Lenngren
That's the difference, If you pass the string "1234" to Read As Integer, you get the Integer 875770417, because "1234" is in ascii 49 50 51 52, and 49 + 50*(2^8) + 51*(2^16) + 52*(2^24) = 875770417. If Input only returns the raw string, the user can do the Val on his/her own afterwards, if he/she

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Jussi Lahtinen
> 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

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Emil Lenngren
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

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Jussi Lahtinen
> 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 inp

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Emil Lenngren
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 > > Input never returns something with spaces in it. It works about the same > > way as scanf("%s", ...), scanf("%d", ...). It

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Jussi Lahtinen
> 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

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Emil Lenngren
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. 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

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Jussi Lahtinen
Wait... How input determines how much is read? To read all what is written with this; hFile = Open "/tmp/testingtesting/Test.txt" For Output Create Print #hFile, "Test1" Print #hFile, 123 Print #hFile, CDate(2484515) Print #hFile, " 1-2/3/4/5_6*7-8+9" Close hFile I need to call inpu

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Jussi Lahtinen
Yes, it works now. Jussi 2012/3/14 Benoît Minisini > Le 14/03/2012 13:12, Jussi Lahtinen a écrit : > >hFile = Open "/tmp/testingtesting/Test.txt" For Output Create > >Print #hFile, "Test1" > >Close hFile > > > >sStr = "" > >hFile = Open "/tmp/testingtesting/Test.txt" For I

Re: [Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Benoît Minisini
Le 14/03/2012 13:12, Jussi Lahtinen a écrit : >hFile = Open "/tmp/testingtesting/Test.txt" For Output Create >Print #hFile, "Test1" >Close hFile > >sStr = "" >hFile = Open "/tmp/testingtesting/Test.txt" For Input >Input #hFile, sStr >Close hFile > > >> From revision 4549

[Gambas-user] Bug / changed behaviour of Input

2012-03-14 Thread Jussi Lahtinen
hFile = Open "/tmp/testingtesting/Test.txt" For Output Create Print #hFile, "Test1" Close hFile sStr = "" hFile = Open "/tmp/testingtesting/Test.txt" For Input Input #hFile, sStr Close hFile >From revision 4549, sStr remains null. Jussi GambasTester-0.9.24.tar.gz Description: G