PyBasic icon indicating copy to clipboard operation
PyBasic copied to clipboard

INPUT into arrays

Open richpl opened this issue 4 years ago • 2 comments

Placeholder to add support for user input directly into an array variable

richpl avatar Oct 18 '21 20:10 richpl

Would it be possible to provide an example of the BASIC syntax that should be supported?

cclauss avatar Oct 29 '21 11:10 cclauss

     10 DIM A(10)
     20 FOR I = 1 TO 10
     30 PRINT "ENTER VALUE NUMBER ";I;
     35 REM *** THE FOLLOWING STATEMENT DOESN'T CURRENT WORK PROPERLY ***
     40 INPUT ": ";A(I)
     50 NEXT I
     60 PRINT "YOU ENTERED: ";
     70 FOR I = 1 TO 10
     80 PRINT A(I);", ";
     90 NEXT I
     100 PRINT
     >RUN
     ENTER VALUE NUMBER 1: 1
     ENTER VALUE NUMBER 2: 7
     ENTER VALUE NUMBER 3: 0
     ENTER VALUE NUMBER 4: 1
     ENTER VALUE NUMBER 5: 6
     ENTER VALUE NUMBER 6: 9
     ENTER VALUE NUMBER 7: 6
     ENTER VALUE NUMBER 8: 4
     ENTER VALUE NUMBER 9: 0
     ENTER VALUE NUMBER 10: 3
     YOU ENTERED: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

     *** SHOULD BE ***
     YOU ENTERED: 1, 7, 0, 1, 6, 9, 6, 4, 0, 3

RetiredWizard avatar Oct 29 '21 18:10 RetiredWizard