AND OR XOR in EXEC_COMMAND2

You are missing a feature or need an enhancement? Post your suggestion here!
Post Reply
fred48fm
Posts: 73
Joined: 28 Aug 2019 09:52
AND OR XOR in EXEC_COMMAND2

Post by fred48fm »

Hi,

It could be usefull to add the ability to use conditions for the EXEC_COMMAND2 command.

For now we need to use long commands like this :
EXEC_COMMAND2 VAR1|Equals(1)|EXEC_COMMAND2 VAR2|Equals(1)|EXEC_COMMAND2 VAR3|Equals(1)|command

Something like EXEC_COMMAND2 VAR1|Equals(1) && VAR2|Equals(1) && VAR3|Equals(1)|command could be really nice.

Thanks

Fred
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: AND OR XOR in EXEC_COMMAND2

Post by radio42 »

Note, that you combine multiple variables (as they are simply treated as a string). E.g. in your example above you might use:
EXEC_COMMAND2 VAR1VAR2VAR3|Equals(111)|command

Explanation: VAR1, VAR2, VAR3 are simply concatenated (placed after each other) and then compared to the string "111".
This condition will will only be true, if all VARs are "1".

An OR condition could be solved similar:
EXEC_COMMAND2 VAR1VAR2VAR3|NOT(Equals(000))|command

Explanation: If either VAR1, VAR2 or VAR3 is "1" it will not be "000".

You might also take a look to the *[IF:...] resp. even other transformation macro function with which almost any logical combination is possible.
Also the "InList" condition might help...

Post Reply