BBC BASIC for Windows
« Cascaded IF »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:53pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Cascaded IF  (Read 302 times)
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Cascaded IF
« Thread started 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
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls