Currently if statements do one test, then an action depending on its result. In reality you often need to go through a list of mutually exclusive conditions and do some operation, such as doing an action based on a menu item.
Here's an example of some hacks to handle multiple checks:
If Command Equals BeginText Hi EndText
Then System Print BeginText Hey there! EndText
Else True BeginNote Does nothing EndNote
EndIf
If Command Equals BeginText Exit EndText
Then System Exit
Else True
EndIf
It would be a lot nicer to write something like:
If Command Equals BeginText Hi EndText
Then System Print BeginText Hey there! EndText
ElseIf Command Equals BeginText Exit EndText
Then System Exit
Else True
EndIf
This seems fairly simple.
Maybe while we're at it we could make the 'Else' optional?
Jookia
change title from syntax: Support chained if statements to syntax: Support chained If directives
on 24 Aug
Currently if statements do one test, then an action depending on its result. In reality you often need to go through a list of mutually exclusive conditions and do some operation, such as doing an action based on a menu item.
Here's an example of some hacks to handle multiple checks:
It would be a lot nicer to write something like:
This seems fairly simple.
Maybe while we're at it we could make the 'Else' optional?