![]() |
|
ELSIF - Printable Version +- Boriel Basic Forum (https://forum.boriel.com) +-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11) +---- Forum: Wishlist (https://forum.boriel.com/forumdisplay.php?fid=14) +---- Thread: ELSIF (/showthread.php?tid=534) |
ELSIF - einar - 2013-03-27 For instance, suppose a game with 5 levels of difficulty, that needs to perform certain tasks depending on this. In ZX BASIC it will look like this: Code: IF level = 1 THENMy suggestion is to add a new keyword "ELSIF", so the code above could be simplified as follows: Code: IF level = 1 THENI know this is not an important feature (the kind of stuff they call "syntactic sugar"), but since this is probably very easy to implement in the compiler and should be very convenient for several programs, I'm suggesting it anyway
Re: ELSIF - boriel - 2013-03-27 This already exists, following FreeBasic convention. It's called ELSEIF. I choose this name instead of ELSIF or ELIF because we decided to follow FreeBasic dialect
Re: ELSIF - einar - 2013-03-27 So that's the reason I could not find it! Thanks
Re: ELSIF - britlion - 2013-04-01 The list of reserved words is your friend. <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Identifier#Reserved_Identifiers">http://www.boriel.com/wiki/en/index.php ... dentifiers</a><!-- m --> Re: ELSIF - LCD - 2013-04-01 I never heard about ELSIF before. Re: ELSIF - boriel - 2013-04-02 hock: Well, it's ELSEIF not ELSIF. It was implemented long ago. |