Page 1 of 1

Addition of CASE statements

Posted: 23 Feb 2018 13:01
by Econdoc
In many other languages, for example C, Java, dBase, Visual FoxPro, or Visual Basic there is a CASE structure which allows for much cleaner code under some circumstances. If you have different blocks of code that need to be executed dependent on the values of a variable, CASE structure is much cleaner than nested ifs.
For example, in FoxPro
DO CASE
CASE (Logical Expression 1)
Block 1
CASE (Logical Expression 2)
Block 2
CASE (Logical Expression 3)
Block 3
OTHERWISE
Block 4
ENDCASE

This is much cleaner code than either multiple 'if then > else" structures or, worse, nested "if then > else" structures.

Any possibility of including this?

Re: Addition of CASE statements

Posted: 23 Feb 2018 14:39
by Desmanto
+1 too.
The keywords are there, let's see if Martin have the time to look it. He's busy lately to keep up with google's requirement for accessibility and notification channel.

Re: Addition of CASE statements

Posted: 15 Mar 2018 17:30
by juvete
+1