Ruud
Veteran Member
Pre-info: I'm busy writing my own BASIC that should be able to boot from floppy on a 8088 machine. It is written from scratch in assembly. The idea is that the code should be Commodore compatible so it be able to run PRG files copied from Commodores.
Not having used INPUT for a very long time, I was playing with it on my C64. The used program was simple:
1 input a,b
2 print a,b
Not knowing any more how you could enter multiple inputs, I started with ‘1 2’. To be sure to read it well, a space between the 1 and the 2.
First surprise: it asked for another input and the second and biggest surprise: the output was ’12 3’. RTFM I found out that I had to use commas as separators instead of spaces. After some time I tried as input ‘1 2 3 4 , 5 6 7 8’ and the result was ‘1234 5678’. To make sure that it were numbers I saw I added 'a+b' at the end of line 2 and I got 6912.
So it seems BASIC simply skips the spaces when reading numerical input. IMHO it shouldn’t do that. But it does. Am I missing something or did I run in a feature?
Not having used INPUT for a very long time, I was playing with it on my C64. The used program was simple:
1 input a,b
2 print a,b
Not knowing any more how you could enter multiple inputs, I started with ‘1 2’. To be sure to read it well, a space between the 1 and the 2.
First surprise: it asked for another input and the second and biggest surprise: the output was ’12 3’. RTFM I found out that I had to use commas as separators instead of spaces. After some time I tried as input ‘1 2 3 4 , 5 6 7 8’ and the result was ‘1234 5678’. To make sure that it were numbers I saw I added 'a+b' at the end of line 2 and I got 6912.
So it seems BASIC simply skips the spaces when reading numerical input. IMHO it shouldn’t do that. But it does. Am I missing something or did I run in a feature?