Hi,
I know this from other languages and would like to see it here too: ShortIf (or whatever it would be called). This is a statement with a single command if it is true. No endif, no else or whatever. This shortens instructions that only need one call after the condition:
chi wrote:I'd prefer something similar to the ternary operator from C/C++ so we could write an If/Else statement in one line!
What do you mean? You can do this already.
Yes, we can! But only with If:Else:Endif keywords or by creating a Macro + Procedure (for each data type) and I'm talking about the shortest possible syntax...
Procedure IIFEval(boolean, y, n)
If boolean : ProcedureReturn y : Else : ProcedureReturn n : EndIf
EndProcedure
Macro IIF(expr, y, n)
IIFEval((Bool(Not(Bool(expr)))), n, y)
EndMacro
c = IIF(a < b, 34, 12)