Author Topic: Multiple criteria IF statements  (Read 5849 times)

omega9380

  • Guest
Multiple criteria IF statements
« on: December 27, 2016, 10:44:31 AM »
A way to check multiple criteria with comparison operators on an IF statement would be nice, such as:

IF variable = "this" OR variable = "that"

or

IF variable = "this" AND variable = "that"

This would save a LOT of command clutter because of not having to use nested IF statements for the same effect.  Thanks!!


EDIT by Pfeil: This functionality is available using the "Condition Builder" feature
« Last Edit: April 18, 2020, 08:43:51 AM by Pfeil »

iceblast

  • Sr. Member
  • ****
  • Posts: 374
Re: Multiple criteria IF statements
« Reply #1 on: December 27, 2016, 12:17:24 PM »
Do you mean something like this?


{EXP: {INT:Y} > {INT:Max} }

Or

{EXP: ({MOUSESCREENY} < {INT:Max}) AND ('{WINDOWTITLEUNDERMOUSE}' LIKE '*Torch' OR '{WINDOWTITLEUNDERMOUSE}' LIKE '*Opera')}
« Last Edit: December 27, 2016, 12:37:27 PM by iceblast »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Multiple criteria IF statements
« Reply #2 on: December 27, 2016, 12:56:09 PM »
The icky part of doing this is you get into situations where you have order of operation (since nobody would want to stop at just two conditions): 

if variable1 = 'this' and variable2 = 'that' or variable3 = 'other'... to make it work right you have to express this as

(if variable1 = 'this' and variable2 = 'that') or variable3 = 'other'
-or-
if variable1 = 'this' and (variable2 = 'that' or variable3 = 'other')

Doing this in a visual, action-block way would be a fair undertaking.  Saving that for later ;)




Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Multiple criteria IF statements
« Reply #3 on: December 27, 2016, 01:13:15 PM »
(if variable1 = 'this' and variable2 = 'that') or variable3 = 'other'
-or-
if variable1 = 'this' and (variable2 = 'that' or variable3 = 'other')
Perhaps a checkbox like "This statement continues the preceding statement" could work?
Code: [Select]
Begin Text Compare : [variable1] Equals 'this'
Continue And Text Compare: [variable2] Equals 'That'
Or Text Compare : [variable3] Equals 'other'
Code: [Select]
Begin Text Compare : [variable1] Equals 'this'
And Text Compare: [variable2] Equals 'That'
Continue Or Text Compare : [variable3] Equals 'other'

Saving that for later ;)
I'm just thinking aloud, of course.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Multiple criteria IF statements
« Reply #4 on: December 27, 2016, 06:47:50 PM »
That seems like a cool way to do it ;)

rpoteat

  • Guest
Re: Multiple criteria IF statements
« Reply #5 on: January 26, 2017, 10:19:53 PM »
The icky part of doing this is you get into situations where you have order of operation (since nobody would want to stop at just two conditions): 

if variable1 = 'this' and variable2 = 'that' or variable3 = 'other'... to make it work right you have to express this as

(if variable1 = 'this' and variable2 = 'that') or variable3 = 'other'
-or-
if variable1 = 'this' and (variable2 = 'that' or variable3 = 'other')

Doing this in a visual, action-block way would be a fair undertaking.  Saving that for later ;)
..

I can understand the difficulty in this undertaking, and know you're up to the challenge. Soo just *how much* would it cost to move this up into the "things that must be in the next release* column?? (i'm sure i can come up with a bucketful of money....  ;D ;) :)