Unable to Input line 88 for variable A7

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

Unable to Input line 88 for variable A7

Post by Triopstor »

Hello.

I'm working on a windows calculation program, when I discovered FreeBasic won't accept input for variable A7 at line 88. Sure would appreciate help.

My computer is Windows 10 operating system on a MSI brand pentium 7.

EDIT: For everyone who reads this post. Just RUN the code and keep pressing ENTER key till you get to line 88 which says "INPUT A7: INPUT A7" Try to make A7 print the number 9 when printed on line "print A2,A7". Thank You.

Code: Select all

'Line 88 fails to input variable A7 twice.

' VARIABLES
' =========
DIM SHARED AS INTEGER X1,X2,X3,X4,X5
DIM SHARED AS INTEGER Y1
DIM SHARED AS INTEGER R1
DIM SHARED AS LONGINT S1,S2,S3,S4,S5
DIM SHARED AS INTEGER R2
DIM SHARED AS INTEGER E1,E2,E3
DIM SHARED AS LONGINT F1,F3
'DIM SHARED AS SINGLE F2
DIM SHARED AS INTEGER LDL1,WDW1
'DIM SHARED AS INTEGER G1
DIM SHARED AS INTEGER H1,H3
DIM SHARED AS SINGLE  H2
DIM SHARED AS INTEGER C1,C2
DIM SHARED AS LONGINT A1,A2
DIM SHARED AS INTEGER A3,A4,A5,A6,A7
DIM SHARED AS LONGINT B1
DIM SHARED AS LONGINT D1,D2
DIM SHARED AS INTEGER F4
DIM SHARED AS INTEGER LB1

R1=500
E1=250
E3=250
LB1=100 
R2=30
C1=4:C2=4
LDL1=E3:WDW1=E1
D1=4990
DIM SHARED AS INTEGER XAxis1(1 TO R1)  
DIM SHARED AS INTEGER YAxis2(1 TO E3+LB1)

'SCREEN
'======
CLS:SCREEN 12:WIDTH 80,43

' QUERRY
' ======
INPUT "Details 1=YES 2=FULL RUN ",S3
  IF S3<=0 THEN S3=2
Input A7
A7=3:S3=1

' MAIN LOOP
' =========
RANDOMIZE TIMER
FOR X1=1 TO R1
    XAxis1(X1)=INT(RND(1)*R2)+1
NEXT X1
PRINT:PRINT
A1=C1:A3=A1:A6=0:B1=0:E2=0:F1=0:F3=0:H1=0:H3=0:H2=1.0000:Y1=0:D2=D1:S2=0:S4=0 'If you change anything See 503(Re-set)

X1=0
DO WHILE X1<=R1
    COLOR 2:PRINT "Begining of loop  X1=";X1:'SLEEP
         
    IF X1=0 THEN
       X1=1:S5=S5+1:Y1=1:YAxis2(Y1)=C1
       A1=C1:A4=B1:COLOR 2:PRINT "SEED IS: ";:FOR X2=1 TO Y1:PRINT YAxis2(X2);:NEXT X2:PRINT ""
    END IF
    X1=X1+1:S5=S5+1
    A1=YAxis2(Y1)+(C2*H2)
    A1=YAxis2(Y1)
        
    IF A1>A3 THEN A3=A1
    E2=E2+A1
    
    COLOR 11:PRINT USING "PLOT A1=####";A1:PRINT USING "PLOT A1=#### D2:#####";A1,INT(D2/1000)
  
    IF XAxis1(X1)>18 THEN
       COLOR 4:PRINT USING "BEFOR X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1
       PRINT "WHAT IS Y1";Y1:'SLEEP
       
       IF Y1=1 AND X1>2 THEN
          COLOR 7:PRINT "Before Split: Y1 WDW1 LDL1 WDW1-LDL1";Y1,WDW1,LDL1,WDW1-LDL1
          B1=B1-A1:A5=B1:Y1=Y1+1:YAxis2(Y1)=A1:LDL1=LDL1-1
          IF A4-A5>A6 THEN A6=A4-A5
          
          A2=0:FOR X2=1 TO Y1:A2=A2+YAxis2(X2):NEXT X2

          FOR X2=1 TO Y1:YAxis2(X2)=0:NEXT X2

          beep:sleep:sleep
          PRINT "Will FreeBasic accept A7 input twice and not go of";A2
          INPUT A7: INPUT A7
          Print "After Input A7":Beep:sleep:sleep
          print "After Input #2":Beep:sleep:sleep
          print A2,A7

          IF A7<=WDW1 THEN
             Y1=A2/A7:WDW1=WDW1-A7
          ELSE
             PRINT "ERROR LIMIT":Sleep:Sleep
          END IF
          DO WHILE A2<>0
             FOR X2=1 TO Y1
                 YAxis2(X2)=YAxis2(X2)+C2
                 A2=A2-C1:IF A2=0 THEN EXIT FOR
             NEXT X2
          LOOP

          COLOR 2:PRINT "Spread out:":FOR X2=1 TO Y1:PRINT YAxis2(X2);:NEXT X2:PRINT ""
          COLOR 7:PRINT "After Split:Y1 WDW1 LDL1 WDW1-LDL1";Y1,WDW1,LDL1,WDW1-LDL1
       ELSE 
          B1=B1-A1:A5=B1:Y1=Y1+1:YAxis2(Y1)=A1:LDL1=LDL1-1
          IF A4-A5>A6 THEN A6=A4-A5
          COLOR 7:PRINT "Y1 WDW1 LDL1 WDW1-LDL1";Y1,WDW1,LDL1,WDW1-LDL1
          FOR X2=1 TO Y1:PRINT YAxis2(X2);:NEXT X2:PRINT ""  
       END IF
       
 
       IF Y1>1 THEN
         
        
          PRINT "Y1 WDW1 LDL1 WDW1-LDL1";Y1,WDW1,LDL1,WDW1-LDL1
          IF S3=4 THEN SLEEP ELSE SLEEP 0

          IF Y1+2<=LDL1 AND WDW1>LDL1+Y1 THEN 
             PRINT "HIDDEN No SETTING IS ";(WDW1)-(LDL1+Y1)
             A2=0
             FOR X2=1 TO Y1
                 A2=A2+YAxis2(X2)
             NEXT X2

             FOR X2=1 TO Y1:YAxis2(X2)=0:NEXT X2

             PRINT "SITUATION"
             IF S3=4 THEN SLEEP ELSE SLEEP 0
             PRINT "(Y1+1)";Y1+1
             Y1=Y1+1
             DO WHILE A2<>0
                FOR X2=1 TO Y1 
                    YAxis2(X2)=YAxis2(X2)+C2  
                    A2=A2-C2:IF A2=0 THEN EXIT FOR
                NEXT X2
             LOOP
 
             COLOR 1:PRINT "HIDDEN No. IS AVAILABLE!":FOR X2=1 TO Y1:PRINT YAxis2(X2);:NEXT X2:PRINT ""
             IF S3=4 THEN SLEEP ELSE SLEEP 0
          ELSE
            

          END IF
       END IF
            
       COLOR 4:PRINT USING "Seen AFTER X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1
       FOR X2=1 TO Y1:PRINT YAxis2(X2);:NEXT X2:PRINT ""
    ELSE
       
       COLOR 4:PRINT USING "Take BEFOR X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1
       F3=F3+1:F1=F1+1:S4=S4+1:A5=B1-A1:B1=B1+ABS(-A1):WDW1=WDW1-1
       IF A4-A5>A6 THEN A6=A4-A5
       IF Y1>0 THEN YAxis2(Y1)=0:Y1=Y1-1
       COLOR 4:PRINT USING "Take AFTER X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1
       PRINT "Y1 WDW1 LDL1 WDW1-LDL1";Y1,WDW1,LDL1,WDW1-LDL1
       FOR X2=1 TO Y1:PRINT YAxis2(X2);:NEXT X2:PRINT ""
   
    END IF

    IF S3=4 THEN SLEEP ELSE SLEEP 0
 
    F4=0
    SELECT CASE Y1
      CASE 0 'NULL
      CASE 1 'NULL
        
        IF X1=INT(D2/1000) THEN F4=2:D2=D2+D1
      CASE ELSE
        IF X1=INT(D2/1000) THEN F4=2:D2=D2+D1
    END SELECT
   
     IF Y1>1 AND F4>0 THEN
        IF F4=1 THEN COLOR 4 ELSE COLOR 2
        PRINT USING "Aberration Computer Generated Number                     ALERT Y1:###### SPIN:###### F4:## SPIN:## ";Y1,INT(D2/1000),F4,XAxis1(X1)'3,X1,INT(X1+72*.405)-F3
       IF Y1>1 THEN 
          IF Y1>1 THEN
          A2=0
          FOR X2=1 TO Y1
              A2=A2+YAxis2(X2)
          NEXT X2
            

          PRINT "BEFOR  ?";:FOR X2=1 TO Y1:PRINT YAxis2(X2);:NEXT X2:PRINT USING " Y1=####";Y1
          YAxis2(Y1)=0:Y1=Y1-1
          
          FOR X2=1 TO Y1:YAxis2(X2)=0:NEXT X2

          DO WHILE A2<>0
             FOR X2=1 TO Y1
                 YAxis2(X2)=YAxis2(X2)+C2
                 A2=A2-C2:IF A2=0 THEN EXIT FOR
             NEXT X2
          LOOP
          PRINT "BEFOR OWE";:FOR X2=1 TO Y1:PRINT YAxis2(X2);:NEXT X2:PRINT USING " Y1=####";Y1

          PRINT USING "A1=#####";A1
          H1=H1+1:H3=H3+1
          END IF
       END IF
       
       PRINT USING "NEXT number     #######";INT(D2/1000)
    ELSE
       
    END IF
   
    IF Y1=0 THEN
       S2=S2+1
       color 12:print "S2=";S2;A3;A6;"---"
       COLOR 4:PRINT USING "ISOLATION OCCURED - WE HAVE #,###,### S5:#,###,###:#,###,### PLOTTED WITH THE GRAPH POINTS POSIBILITIES(F1)=######### @ S4:#########  H1:######### H3:#########";R1,S5,B1,F1,S4,H1,H3
       IF S3=4 THEN SLEEP ELSE SLEEP 0
       
       IF S2=10000  THEN 

          COLOR 11:PRINT:PRINT:PRINT SPACE(20); "< S2:";S2; " All Numbers Completed. Please Press ESC >"
          DO
            X5=GETKEY
          LOOP UNTIL X5=27
          SYSTEM
       END IF 
       IF S3=1 OR S3=2 THEN

          PRINT "Would you like to continue? Enter/Space=YES ESC=EXIT"
          IF S3=1 THEN
             DO
               X5=GETKEY
             LOOP UNTIL X5=27 OR X5=13 OR X5=32
          ELSE
             X5=13
          END IF
          SELECT CASE X5
            CASE 13,32

              A1=C1:H3=0:Y1=0:D2=D1:S4=0:F3=0
              LDL1=E3:WDW1=E1
              IF A1>A3 THEN A3=A1

              FOR X1=1 TO R1
                  XAxis1(X1)=INT(RND(1)*R2)+1
              NEXT X1
            CASE 27
              SYSTEM
            CASE ELSE
              PRINT "Error Encountered - Unknown Key":sleep:system
          END SELECT
       END IF

       X1=0 :print "End of loop  X1";X1:'sleep
    END IF

LOOP
COLOR 12:PRINT "Row and Column failure!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
COLOR 12:PRINT USING "ISOLATION #2 OCCURED - WE HAVE #### PLOTTED WITH THE GRAPH POINTS POSIBILITIES(F1)=######### H1:#########";B1/10,F1,H1
IF S3=1 THEN SLEEP
SLEEP
COLOR 12:PRINT "FAILURE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"

COLOR 12:PRINT:PRINT:PRINT SPACE(30); "<Please Press ESC>"
DO
  X5=GETKEY
LOOP UNTIL X5=27
SYSTEM



Last edited by Triopstor on Oct 18, 2021 9:29, edited 2 times in total.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Unable to Input line 88 for variable A7

Post by jj2007 »

I get an impressing number of cryptic error messages; does your IDE impose any special settings?

Code: Select all

TmpFb.bas(71) error 47: Expected ';', found 'INT' in 'COLOR 11:PRINT USING "PLOT A1=####";A1:PRINT USING "PLOT A1=#### D2:#####";A1,INT(D2/1000)'
TmpFb.bas(74) error 47: Expected ';', found 'XAxis1' in 'COLOR 4:PRINT USING "BEFOR X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1'
TmpFb.bas(149) error 47: Expected ';', found 'XAxis1' in 'COLOR 4:PRINT USING "Seen AFTER X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1'
TmpFb.bas(153) error 47: Expected ';', found 'XAxis1' in 'COLOR 4:PRINT USING "Take BEFOR X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1'
TmpFb.bas(157) error 47: Expected ';', found 'XAxis1' in 'COLOR 4:PRINT USING "Take AFTER X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1'
TmpFb.bas(177) error 47: Expected ';', found 'INT' in 'PRINT USING "Aberration Computer Generated Number                     ALERT Y1:###### SPIN:###### F4:## SPIN:## ";Y1,INT(D2/1000),F4,XAxis1(X1)'3,X1,INT(X1+72*.405)-F3'
TmpFb.bas(212) error 47: Expected ';', found 'S5' in 'COLOR 4:PRINT USING "ISOLATION OCCURED - WE HAVE #,###,### S5:#,###,###:#,###,### PLOTTED WITH THE GRAPH POINTS POSIBILITIES(F1)=######### @ S4:#########  H1:######### H3:#########";R1,S5,B1,F1,S4,H1,H3'
TmpFb.bas(255) error 47: Expected ';', found 'F1' in 'COLOR 12:PRINT USING "ISOLATION #2 OCCURED - WE HAVE #### PLOTTED WITH THE GRAPH POINTS POSIBILITIES(F1)=######### H1:#########";B1/10,F1,H1'
TmpFb.bas(71) error 47: Expected ';', found 'INT' in 'COLOR 11:PRINT USING "PLOT A1=####";A1:PRINT USING "PLOT A1=#### D2:#####";A1,INT(D2/1000)'
TmpFb.bas(74) error 47: Expected ';', found 'XAxis1' in 'COLOR 4:PRINT USING "BEFOR X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1'
TmpFb.bas(149) error 47: Expected ';', found 'XAxis1' in 'COLOR 4:PRINT USING "Seen AFTER X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1'
TmpFb.bas(153) error 47: Expected ';', found 'XAxis1' in 'COLOR 4:PRINT USING "Take BEFOR X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1'
TmpFb.bas(157) error 47: Expected ';', found 'XAxis1' in 'COLOR 4:PRINT USING "Take AFTER X1:#### S1:##  B1:##### A1:##### E2:#####  Y1:####  ";X1,XAxis1(X1),B1,A1,E2,Y1'
TmpFb.bas(177) error 47: Expected ';', found 'INT' in 'PRINT USING "Aberration Computer Generated Number                     ALERT Y1:###### SPIN:###### F4:## SPIN:## ";Y1,INT(D2/1000),F4,XAxis1(X1)'3,X1,INT(X1+72*.405)-F3'
TmpFb.bas(212) error 47: Expected ';', found 'S5' in 'COLOR 4:PRINT USING "ISOLATION OCCURED - WE HAVE #,###,### S5:#,###,###:#,###,### PLOTTED WITH THE GRAPH POINTS POSIBILITIES(F1)=######### @ S4:#########  H1:######### H3:#########";R1,S5,B1,F1,S4,H1,H3'
TmpFb.bas(255) error 47: Expected ';', found 'F1' in 'COLOR 12:PRINT USING "ISOLATION #2 OCCURED - WE HAVE #### PLOTTED WITH THE GRAPH POINTS POSIBILITIES(F1)=######### H1:#########";B1/10,F1,H1'
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Unable to Input line 88 for variable A7

Post by fxm »

In the 'Print Using' statement, the items to format must be separated by semi-colons (;).
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: Unable to Input line 88 for variable A7

Post by counting_pine »

I can't easily tell without copy/pasting into a text editor, but I'm guessing this is the code starting at line 88:

Code: Select all

Input A7
A7=3:S3=1
...
Whatever value Input gives A7, it will assigned a value of 3 immediately after.

EDIT: or maybe it's here?

Code: Select all

          PRINT "Will FreeBasic accept A7 input twice and not go of";A2
          INPUT A7: INPUT A7
          Print "After Input A7":Beep:sleep:sleep
          print "After Input #2":Beep:sleep:sleep
          print A2,A7
I'm not sure what this code is trying to do..

I guess I should ask: is A7 getting the wrong value, or is there some kind of error? That would be helpful to know.
Triopstor
Posts: 106
Joined: Apr 25, 2006 13:11

Re: Unable to Input line 88 for variable A7

Post by Triopstor »

Thanks for your reply jj2007.

That is an impressive amount of error messages. But I get none. I'm using FBIde 0.4.6 as a IDE and have no special settings for that. Which IDE do you use?

Sincerely, Triopstor
Triopstor
Posts: 106
Joined: Apr 25, 2006 13:11

Re: Unable to Input line 88 for variable A7

Post by Triopstor »

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.
Triopstor
Posts: 106
Joined: Apr 25, 2006 13:11

Re: Unable to Input line 88 for variable A7

Post by Triopstor »

counting_pine wrote:I can't easily tell without copy/pasting into a text editor, but I'm guessing this is the code starting at line 88:

Code: Select all

Input A7
A7=3:S3=1
...
Whatever value Input gives A7, it will assigned a value of 3 immediately after.

EDIT: or maybe it's here?

Code: Select all

          PRINT "Will FreeBasic accept A7 input twice and not go of";A2
          INPUT A7: INPUT A7
          Print "After Input A7":Beep:sleep:sleep
          print "After Input #2":Beep:sleep:sleep
          print A2,A7
I'm not sure what this code is trying to do..

I guess I should ask: is A7 getting the wrong value, or is there some kind of error? That would be helpful to know.
Hi counting_pine! You are still here after years! Hope you are in good health!

line 88 "The INPUT A7:INPUT A7" gets bypassed(doesn't stop for input) and equals zero(0) when printed on line "print A2,A7"

For everyone who reads this post. Just RUN the code and keep pressing ENTER key till you get to line 88 which says "INPUT A7: INPUT A7" Try to make A7 print the number 9 when printed on line "print A2,A7". Thank You.
fxm
Moderator
Posts: 12107
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: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)
What version of fbc are you using ?
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Unable to Input line 88 for variable A7

Post by jj2007 »

Triopstor wrote:I'm using FBIde 0.4.6 as a IDE and have no special settings for that. Which IDE do you use?
No IDE. I use the commandline with FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for win32 (32bit) (the info you get with fbc -version). See fxm's comment, though:
fxm wrote: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)
What version of fbc are you using ?
Triopstor
Posts: 106
Joined: Apr 25, 2006 13:11

Re: Unable to Input line 88 for variable A7

Post by Triopstor »

See fxm's comment, though:
fxm wrote: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)
What version of fbc are you using ?
[/quote]


I'm using fbc 1.08.1 winlibs-gcc-9.3.0 windows 64-bit. The latest.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Unable to Input line 88 for variable A7

Post by fxm »

How come you haven't seen this error ?
- PRINT USING now disallows commas between expressions (they had the same effect as semi-colons)
Check your fbc version with:

Code: Select all

Print __FB_Version__
Sleep
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Re: Unable to Input line 88 for variable A7

Post by angros47 »

When your program pauses (at the line with "beep:sleep:sleep"), how do you exit the pause? By chance, do you press enter?
If so, the key press will remain in buffer, and it will be immediately taken by the next INPUT command
Triopstor
Posts: 106
Joined: Apr 25, 2006 13:11

Re: Unable to Input line 88 for variable A7

Post by Triopstor »

angros47 wrote:When your program pauses (at the line with "beep:sleep:sleep"), how do you exit the pause? By chance, do you press enter?
If so, the key press will remain in buffer, and it will be immediately taken by the next INPUT command
Hi angros47. I'm very careful in slowing down my sleep pauses. That's why I put in the "beep" so I slow down. If the key presses remain in the buffer, how do I clear the buffer? Are you able to input the number 9 on line 88 of the running code? Yes I'm exiting the pause by the enter key.
Last edited by Triopstor on Oct 22, 2021 5:39, edited 1 time in total.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Unable to Input line 88 for variable A7

Post by fxm »

fxm wrote:Check your fbc version with:

Code: Select all

Print __FB_Version__
Sleep
Did you do it?
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Unable to Input line 88 for variable A7

Post by fxm »

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 ...
Post Reply