Unable to Input line 88 for variable A7

Windows specific questions.
Triopstor
Posts: 106
Joined: Apr 25, 2006 13:11

Re: Unable to Input line 88 for variable A7

Post by Triopstor »

fxm wrote:
fxm wrote:Check your fbc version with:

Code: Select all

Print __FB_Version__
Sleep
Did you do it?
Okay I did it and got the result:
0.23.0
Triopstor
Posts: 106
Joined: Apr 25, 2006 13:11

Re: Unable to Input line 88 for variable A7

Post by Triopstor »

fxm wrote:Each 'Sleep' keyword in the code waits a key is pressed to continue the code execution, but 'Sleep' does not clear the keyboard buffer and any key pressed during a call to 'Sleep' is retained and can then be read automatically by 'Input'.
In order to wait for a key press (due to 'Sleep' keyword), and then remove the key from the buffer, 'While InKey <> "" : Wend' can be placed after the 'Sleep' keyword.
(afterwards, a single 'Input' is enough)

Code: Select all

Sleep
While Inkey <> ""
Wend
Input ...
Wow! I learned something. Thank You fxm. Would this work also?

Code: Select all

DO: X5=GETKEY: LOOP UNTIL X5=27 OR X5=13 OR X5=32
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Unable to Input line 88 for variable A7

Post by fxm »

Triopstor wrote:
fxm wrote:
fxm wrote:Check your fbc version with:

Code: Select all

Print __FB_Version__
Sleep
Did you do it?
Okay I did it and got the result:
0.23.0
So in fact you are compiling with the very old fbc 0.23 version, not the fbc 1.08.1 version as you might think.
This explains why you don't get the compilation errors for commas instead of semicolons:
fxm wrote:
Triopstor wrote:
fxm wrote:In the 'Print Using' statement, the items to format must be separated by semi-colons (;).
Thank You fxm. I didn't notice that -- the semi-colons (;). Still the program by passes line 88. I think FreeBASIC accepts comma (,) delimiters.
It is a change since fbc version 0.24.0:
- PRINT USING now disallows commas between expressions (they had the same effect as semi-colons)
It reminds me of the very old package: FBIde + FreeBASIC (FBIde 0.4.6r4 and FreeBASIC 0.23.0).
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Unable to Input line 88 for variable A7

Post by fxm »

Triopstor wrote:Would this work also?

Code: Select all

DO: X5=GETKEY: LOOP UNTIL X5=27 OR X5=13 OR X5=32
This will empty all characters in the keyboard input buffer until it finds one equal to 'ESC' or 'CR' or 'SP', but not subsequent ones if there are any.
Having multiple characters in the keyboard input buffer can occur when, for example, there have been multiple 'Sleep' before one 'Getkey', or using 'Sleep x, 1' (the wait cannot be interrupted by a key press).
Post Reply