Expand "if" command
Posted: Sat Dec 06, 2008 10:56 am
Hi
1. It would be very useful to have a command "between" (like SQL). At this momment I'm using this macro
But it would be much more readable this construct:
2. Also we need to check same datafield against a lot of values (chained by OR), like this:
Instead, I can use this construct:
But it's not the same thing
BOTH cases can be unified in the next (generic) construct:
1. It would be very useful to have a command "between" (like SQL). At this momment I'm using this macro
Code: Select all
macro between(btwfld, btwfrm, btwto)
btwfld >= btwfrm AND btwfld <= btwto
endmacro
...
if between(datafield, valuefrom, valueto) ...
Code: Select all
if datafield between valuefrom and valueto ...
Code: Select all
if datafield = value1 OR value2 OR value3 ...
Code: Select all
select datafield
case value1, value2, value3:,,,
default: ...
endselect
BOTH cases can be unified in the next (generic) construct:
Code: Select all
if datafield [>=<] value1 [AND,OR] [>=<] value2 ....