AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Combining serveral ANDs and ORs with if and Variables

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
aaffe



Joined: 17 May 2007
Posts: 66

PostPosted: Fri Dec 14, 2007 1:31 pm    Post subject: Combining serveral ANDs and ORs with if and Variables Reply with quote

Hallo,
I´ve got a question.
In an If-Command, you can use variables in exporessions like
Code:

If (varA > varB) ....

of you can use it like this:
Code:

if varA > %varB....

But how to write it if I want to combine several ands and ors in if-command?
do it like this?
Code:

If (varA > varB) or (varC > var D) and  (varA != varD) ...
??

Is this right to combine them?
or do you write it like this:
Code:

If varA > %varB% and %varC% > %varD% ...

or like this?
Code:

If varA > %varB% and VarC > %VarD% ...??

Can you help me please?

Thanx, aaffe
Back to top
View user's profile Send private message
tic



Joined: 22 Apr 2007
Posts: 1348

PostPosted: Fri Dec 14, 2007 6:59 pm    Post subject: Reply with quote

Code:
If (varA > varB) or (varC > varD) and  (varA != varD) ...


is fine, except you shoulde use extra brackets so you know which order to do them in...

ie..

Code:
If ((varA > varB) or (varC > varD)) and  (varA != varD) ...
Back to top
View user's profile Send private message
aaffe



Joined: 17 May 2007
Posts: 66

PostPosted: Mon Dec 17, 2007 2:22 pm    Post subject: Reply with quote

Thanx a lot, tic!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group