Addition of CASE statements

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Addition of CASE statements

Post by Econdoc » 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?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Addition of CASE statements

Post by Desmanto » 23 Feb 2018 14:39

+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.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
juvete
Posts: 13
Joined: 29 Mar 2013 22:01

Re: Addition of CASE statements

Post by juvete » 15 Mar 2018 17:30

+1

Locked