Jump to content
Sign in to follow this  
kl99

Extended Basic - Is this a Syntax Error or an Interpreter Bug?

Recommended Posts

Posted (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 by kl99

Share this post


Link to post
Share on other sites

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

  • Like 2
  • Thanks 3

Share this post


Link to post
Share on other sites

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 [email protected]
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"

 

 

 

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...