ELSEIF ...THEN;

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
KenDown
Posts: 327
Joined: Wed 04 Apr 2018, 06:36

ELSEIF ...THEN;

Post by KenDown »

There is reference on another group to a command ELIF (of which I have never heard) which supposedly is mirrored by the command ELSEIF followed by a semicolon. Unfortunately I can't find any reference to this command or its syntax or uses in the Help section, even though it is supposedly available for BB4W. Can anyone advise, please? (I have 6.15a)
Hated Moron

Re: ELSEIF ...THEN;

Post by Hated Moron »

KenDown wrote: Thu 07 Jul 2022, 18:30 Unfortunately I can't find any reference to this command or its syntax or uses in the Help section
It is there, in the documentation of the THEN keyword:

"THEN may be followed immediately by a semicolon (;) to aid translation of the ELSEIF keyword available in some other BASIC dialects, for example:

      IF condition1 THEN
       PROCone
      ELSEIF condition2 THEN;
       PROCtwo
      ELSEIF condition3 THEN;
       PROCthree
      ENDIF


As it says there, this facility is primarily intended for use when translating other BASIC dialects to BBC BASIC. Generally it is better to use the CASE TRUE OF construction if writing a program from scratch in BBC BASIC.
Hated Moron

Re: ELSEIF ...THEN;

Post by Hated Moron »

I would add that the ELSEIF ... THEN; usage has been mentioned at this forum before, for example in November 2019 here.