Addition of CASE statements
Posted: 23 Feb 2018 13:01
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?
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?