Author Topic: How Implement Conditional And / Or  (Read 2248 times)

CrossWiseRanger

  • Newbie
  • *
  • Posts: 13
How Implement Conditional And / Or
« on: February 06, 2017, 09:42:07 AM »
Newbie here.

Finally, after much searching, discovered that VA does not have "And" or "Or" conditionals.  Even found the reason why.  Okay, how do I execute the function in VA?  I'm missing a concept here!

Understand Loop block has one variable that evaluates to T / F.

How do I check for two switches still True in a loop, such as:

Start Loop While : ((Text Compare : [STATE_JOYSTICK2BUTTON:4] Equals '1' )
AND
(Text Compare : [STATE_JOYSTICK2BUTTON:6] Equals '1'))


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: How Implement Conditional And / Or
« Reply #1 on: February 06, 2017, 10:41:48 AM »
You can use the "{EXP:}"(expression) token for this:
Code: [Select]
Start Loop While : [{EXP: {STATE_JOYSTICK2BUTTON:4} + {STATE_JOYSTICK2BUTTON:6}}] Equals '2'
Or, if you prefer explicit checks:
Code: [Select]
Start Loop While : [{EXP: {STATE_JOYSTICK2BUTTON:4} = 1 And {STATE_JOYSTICK2BUTTON:6} = 1}] Equals '1'

Page 111 of VoiceAttackHelp.pdf.

CrossWiseRanger

  • Newbie
  • *
  • Posts: 13
Re: How Implement Conditional And / Or
« Reply #2 on: February 06, 2017, 11:44:47 AM »
Argh - was in plain site in the help.pdf, once no longer blind.

You are the man, thanks.