kl99 Posted August 1, 2019 Share Posted August 1, 2019 (edited) Hi Guys, yesterday I have run into a nasty Syntax Error in Extended Basic, which also occurs in RXB. I don't understand it and wonder if the line really contains a Syntax Error or this is a Interpreter Bug. Version 1: 1 IF A=1 THEN 2 ELSE FOR I=1 TO 2 :: PRINT I :: NEXT I 2 END Version 2: 1 IF A=1 THEN 2 :: FOR I=1 TO 2 :: PRINT I :: NEXT I 2 END Both versions complain about a Syntax Error in Line 1. I would like to analyze it with the help of you and maybe RXB can be even fixed. Edited August 1, 2019 by kl99 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted August 1, 2019 Share Posted August 1, 2019 It is not a bug. The XB manual clearly states on page 95: “The IF-THEN-ELSE statement cannot contain DATA, DEF, DIM, FOR, NEXT, OPTION BASE, SUB, or SUBEND.” ...lee 2 3 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 1, 2019 Share Posted August 1, 2019 I ran into this in the 10 line programming challenge. I think TI was being overcautious. By turning off prescan in line 95 the following runs as expected. 90 A=2 :: I=1 95 !@P- 100 IF A=1 THEN 200 ELSE FOR I=1 TO 2 :: PRINT I :: NEXT I 200 PRINT "LINE 200" But it's easy enough to fix this by breaking up the line: 100 IF A=1 THEN 200 110 FOR I=1 TO 2 :: PRINT I :: NEXT I 200 PRINT "LINE 200" 4 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.