breakintoprogram / agon-bbc-basic-adl

Official AGON QUARK Firmware: BASIC Interpreter (ADL version)
zlib License
15 stars 0 forks source link

Issue with ON statement in BASIC ADL #8

Closed tonedef71 closed 9 months ago

tonedef71 commented 9 months ago

When I run the following BASIC test program, BASIC ADL gives me an error "Syntax error at line 30". The program executes fine in the original Agon BBC BASIC.

   10 REPEAT
   20   H% = FN_RANDINT(1, 5)
   30   ON H% PROC_ONE,PROC_TWO,PROC_THREE,PROC_FOUR,PROC_FIVE:ELSE 10
   40 UNTIL FALSE
   50 END
   60 DEF FN_RANDINT(LO%, HI%)=INT(RND(1)*(HI% - LO% + 1)) + LO%
   70 DEF PROC_ONE:PRINT "ONE":ENDPROC
   80 DEF PROC_TWO:PRINT "TWO":ENDPROC
   90 DEF PROC_THREE:PRINT "THREE":ENDPROC
  100 DEF PROC_FOUR:PRINT "FOUR":ENDPROC
  110 DEF PROC_FIVE:PRINT "FIVE":ENDPROC

TEST_ON.zip

breakintoprogram commented 9 months ago

Ah. I think that's another function I've not touched. Good spot.

breakintoprogram commented 9 months ago

NB: This does not affect ON ... GOTO or ON ... GOSUB