BBC BASIC for Windows
Programming >> BBC BASIC language >> Cascaded IF
http://bb4w.conforums.com/index.cgi?board=language&action=display&num=1489999384

Cascaded IF
Post by DDRM on Mar 20th, 2017, 08:43am

Richard has posted a nice section on a relatively little known form of the IF...THEN statement here:

http://bbcbasic.conforums.com/index.cgi?board=language&action=display&num=1489678877

Basically, if you want to use set of ELSEIF (=ELSE IF) statements to test a set of conditions, you can put a semicolon after each THEN, to avoid a cascade of ENDIFs at the end of the block.

This feature was added to facilitate autotranslation from other BASIC dialects: Richard points out that you can do essentially the same in BB4W with the CASE statement, probably more clearly.

It's actually covered in the manual, under THEN, but not if you just look under IF....

Best wishes,

D