Author Message
mguthrie
Joined: Jun 19, 2018
Messages: 38
Offline
I'm having an issue where I can't get AND statements to work properly with my IF statements. I have two variables as play here:

MistakeCounter
DTMFMode

When MistakeCounter = 1 and DTMFMode = false, my AND statement (which is attached in a screenshot) is getting triggered. It's behaving like an OR statement. It should only be triggered if MistakeCounter is greater than or equal to 2, but it fires off even when it's 1.

If instead I use a nested IF statement without an AND, it works perfectly fine (also attached.)

When I uncollapse the MistakeCounter >= 2 statement, the code that changes DTMFMode to true is no longer shown, so I know I have nested it correctly. (Also attached.)

What am I doing wrong?
  • [Thumb - DTMF2.PNG]
[Disk] Download
  • [Thumb - DTMF3.PNG]
[Disk] Download
  • [Thumb - DTMF1.PNG]
[Disk] Download
massimo__croci
Joined: Jan 31, 2020
Messages: 518
Offline
Hi Michael.

- DTMF1.PNG: For the "If"-"AND"-"conditions", take a look at this old thread from Wilson
https://www.devconnectprogram.com/forums/posts/list/22486.page#p155324

If I remind fine, in the OD 8.x 'Compound' was replaced by 'Complex';

- DTMF2.PNG and - DTMF3.PNG: That is a valid workaround for your project but it is a nested "If".



More detailed support is available through higher level (paid) memberships to the program

https://www.devconnectprogram.com/site/global/program_benefits/membership_overview/index.gsp#membershipLevels

opening a Devconnect technical support ticket by going to the DevConnect Portal page, and following the links through "Support & Forums" -> "Submit Support Ticket" -> "Technical Support"

mguthrie
Joined: Jun 19, 2018
Messages: 38
Offline
So you're saying that the fact that AND statements are behaving this way is intentional?
massimo__croci
Joined: Jan 31, 2020
Messages: 518
Offline
What Wilson suggested on the old post is the proper way to setup the "If"-"AND"/"OR"-"conditions".
mguthrie
Joined: Jun 19, 2018
Messages: 38
Offline
I've attached another image. They want the if statement to be left blank when using AND or OR. Normally this would cause an error in the application, but it works. I don't understand why it was designed that way, but at least it works. Thanks.
  • [Thumb - DTMF4.PNG]
[Disk] Download
massimo__croci
Joined: Jan 31, 2020
Messages: 518
Offline
Not at all. In this way you can immediately recognize the operator (AND/OR) and all conditions. You can also quickly get more complex statements.
Go to:   
Mobile view