Hi Josh,

Can't be done. The BASIC ROM will either execute everything between "IF" and "ELSE" or everything after "ELSE" to the end of the line. The best you could do is put your code that you want to run unconditionally after the imaginary "END IF" in a separate line/lines and call GOSUB from both the "IF" code block as well as the "ELSE" code block.

10 IF A=1THEN B=2:GOSUB50:PRINT"DO SOME MORE STUFF":GOSUB80 ELSE B=3:GOSUB50:PRINT "DO SOME DIFFERENT STUFF":GOSUB80

50 IFB=2THEN PRINT"Do stuff when B is 2":RETURN:ELSE PRINT"Do stuff when B is 3":RETURN
80 ETC.

Ken

On 1/30/18 4:39 PM, Josh Malone wrote:
Hi all,

The 2018 Basic 10-liner contest has started and I've decided to
attempt an entry on my T102, but, I'm running into a major obstacle in
the model-T basic syntax. It appears that the only way to end an
IF-THEN-ELSE clause is to start a new line. I can't find any way to
END IF in the 102 BASIC.

Is there a good reference for the actual syntax of the 100/102 BASIC?
I've been through the "Applications and BASIC Reference" for the 102
and it doesn't cover the details of IF-THEN-ELSE very well.

Is anybody else partaking in this contest?

-Josh

Reply via email to