AND / OR conditional and parenthetic modifiers

Buzzed Aldrin

  • Joined: Jan 14, 2014
  • Posts: 48

Thu 3/20/2014 - 23:09

I'd really like to see AND/OR as actions or at least conditional modifiers.

Any desired logic can of course be accomplished with multiple or nested statements, but I think conditionals containing AND/OR joiners are much less confusing, thus less error-prone. I think this is one of those usability issues that ultimately affects functionality because it makes things so much easier to do.

I have more confidence that jobs will run as intended when I don't need to use relatively obscure syntax workarounds as described in this thread.

The structure would be simple and intuitive, either as standalone actions:

If %A% = 1

AND

If %B% = 2

AND

If %C% = 3

   Action

End If

.... or as modifiers:

If %A% = 1 AND

If %B% = 2 AND

If %C% = 3

   Action

End If

==============================================

A further enhancement would be parenthetic operators to explicitly define Boolean hierarchy.

This might be the desired logic:  If A=1 AND (If B=2 OR If C=3) then Action

Or it might be this:  If (A=1 AND If B=2) OR If C=3 then Action

Instead of fretting over Boolean rules, just explicitly define it, simply putting a break at each operator so, assuming the first case is what's intended, it would be:

If %A%=1

AND

(

If %B%=2

OR

If %C%=3

)

   Action

End if

A case like the following would be a mess with nested conditionals:

If A=1 AND (If B=2 OR (If C=3 AND (If D=4 OR If E=5))) then Action

but rather trivial using AND/OR and parentheses:

If %A%=1

AND

(

If %B%=2

OR

(

If %C%=3

AND

(

If %D%=4

OR

If %E%=5

)

)

)

   Action

End If

I've used another macro program having standalone AND/OR actions, and it goes far in terms of simplifying script creation; hope AND/OR capability will be reconsidered for a future release.

#1

JosephB

  • Joined: Nov 13, 2009
  • Posts: 1039

Thu 3/20/2014 - 23:20

Hello Winautomation Team,

I would like to see the current  "If Action" properties screen have the below layout, in order to support easy auto generation of Multiple AND's / OR's on the  "If Action" ......

 

1.  How about considering an Enhancement Rquest to the 'IF Action", where the "IF Action" Panel would have a button to click to add an "AND". or "OR" to the conditon that your testing.  Perhaps allow for at least a  max. of (4) "AND", "OR" to be added, if you must have a max. limitation (of course no max. limit would be the best)

  ---->   For Example, "IF Action - Panel", could be Enhanced with the following entry boxes:

    First Operand       _________________________ Operator  ___

    Second Operand  ______________________________                AND/OR  (Click)

 

    First Operand       _________________________ Operator  ___

    Second Operand  ______________________________                 AND/OR  (Click)

 

    First Operand       _________________________ Operator ___

    Second Operand  ______________________________                 AND/OR  (Click)

 

    First Operand       _________________________ Operator  ___

    Second Operand  ______________________________

 

 2 Then I feel it should generate the below, "Clean looking code", in the Job Designer: ... However, when the IF action is generated for Job Designer, for things to be clean, in my opinion, Job Designer should generate the compound AND/OR's on the Right Side to be visually clean for following the logic.

 

For Example, I have always found the below to be the cleanest coding/viewing IF structure across various coding languages:

 

If  abc_mm = 12  And

    abc_dd  =  31  And 

    abc_yy  = 11

      action  

End If

 

#2

JosephB

  • Joined: Nov 13, 2009
  • Posts: 1039

Fri 3/21/2014 - 0:24

Hello Anyone, that is interested ......

For Anyone, that needs a Quick Reference to the Syntax of using  "Multiple"  OR's /  AND's in an If Action, you can refer to the below snapshots, as the "Syntax" is not in the On-line documentation, at all.  But. its very valuable to use If's with "Multiple" AND's/OR's, as it greatly reduces the job complexity.

  ... I use them all the time and they work just fine  (albeit, its just not that straight forward, for many users, and especially since its not documented in the online help).

  ... It is strange that it still is not documented, even in V5 online help.

 

If_Check_AND_Conditions.png If_Check_OR_Conditions_Number_Variables.png If_Check_OR_Conditions.png

#3

Buzzed Aldrin

  • Joined: Jan 14, 2014
  • Posts: 48

Fri 3/21/2014 - 0:57

Thanks for that.  Hopefully the "cheat sheets" won't become a crutch to too many people, leading the WA folks to rationalize that adding AND/OR functionality isn't really necessary crying

#4

JosephB

  • Joined: Nov 13, 2009
  • Posts: 1039

Fri 3/21/2014 - 4:52

Buzzed,

I agree with you, AND/OR  auto generation on the "If Action - properties screen" - "really needs to be implemented"  to make this a whole lot easier for everyone.

.... Marios, Samantha, Peter, or John  -  feedback ?

#5

Buzzed Aldrin

  • Joined: Jan 14, 2014
  • Posts: 48

Fri 3/21/2014 - 5:31

The workaround syntax is a good approach for the interim, although I don't want to sound like I'm satisfied with it in lieu of bona fide AND/OR functionality. The conditionals represented by these rather cryptic workaround expressions would otherwise be easily created as plain-language commands with the suggested enhancements via the If Properties dialog (if not standalone actions).

Anyway, the workaround syntax appears to work for combined text/numeric and even complex parenthetic expressions with mixed AND/OR conditions.

The attached example illustrates the statement: If Var1=A AND (Var2=2 OR Var3=C) is true…

Mixed_text+numeric+AND+OR_conditional_statement.PNG

#6

JosephB

  • Joined: Nov 13, 2009
  • Posts: 1039

Fri 3/21/2014 - 7:02

Buzzed Aldrin,

Thats good to know that parenthesis works also !!!  ... I had not tried parenthesis yet in wa.

yes

#7

Buzzed Aldrin

  • Joined: Jan 14, 2014
  • Posts: 48

Fri 3/21/2014 - 18:12

I think standalone AND/OR actions would be better than modifier options in the If Properties dialog.

The options of course could be added to all the If actions, but that would seem redundant, given the nine (9) conditionals available. I think standalone AND/OR actions would be more explicit and conceptually cleaner. And if parenthesis capability were also added, the AND/OR operators would probably need to be standalone. I'm guessing that adding standalone AND/OR actions would be easier than having to modify all the If actions thus less programming effort for the WA crew wink  When it comes to this AND/OR issue, I'd rather see a simple enhancement added, even if it's not the preferred one (if one prefers an AND/OR option on the same line as the conditional), than no enhancement at all.

#8

JosephB

  • Joined: Nov 13, 2009
  • Posts: 1039

Fri 3/21/2014 - 19:53

Buzzed Aldrin,

I hope you realize that even a request like this would most likely still take at least one year, if it even makes it as a priority, for the next release of V6.  .... As, there are many important requests in the request queue.

wink

P.S.  Still personally, like a future AND/OR - Modifer next to the conditional itself, for ease of readability, but thats just my view.

#9

John M

  • Joined: Apr 20, 2013
  • Posts: 15

Fri 3/21/2014 - 22:33

there is other hidden secret Joseph?  thanks.

#10

JosephB

  • Joined: Nov 13, 2009
  • Posts: 1039

Fri 3/21/2014 - 23:19

John M,

hmmm.  ....  well, are you aware that that wa can do math like add, subtract, multiply and division, nut its also not documented in the online help.  I think thats the important hidden secret for many.

#11

John M

  • Joined: Apr 20, 2013
  • Posts: 15

Thu 3/27/2014 - 18:41

Hi Joseph, I'm not sure which math you are talking about, like inside a variable like %(var1+var2)/var3%?  Do you received a notification email each time a request has been answered on this forum? Because I don't. Any setting to do that? Thanks by the way, I already used a lot if == and &&.
john

#12

JosephB

  • Joined: Nov 13, 2009
  • Posts: 1039

Thu 3/27/2014 - 19:02

Hi John M,

Hi Joseph, I'm not sure which math you are talking about, like inside a variable like %(var1+var2)/var3%?

Yes, that is what I meant, as many users do not know about this capabilty as its not mentioned in the Online help docs.

 

Do you received a notification email each time a request has been answered on this forum? Because I don't. Any setting to do that?

No and No.

... In one of the recent threads, wa team, mentioned that they are working on new forum software that should provide the above type of capabilities.

#13

John M

  • Joined: Apr 20, 2013
  • Posts: 15

Mon 3/31/2014 - 3:48

Well, many thanks Joseph.

#14

iampedro

  • Joined: Jan 30, 2012
  • Posts: 76

Tue 4/1/2014 - 12:48

+1 nice to have this added feature

#15
Not a member yet? Register

Copyright 2014 - Softomotive Ltd