AutoHotkey Community

It is currently May 27th, 2012, 12:49 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Is this legit.
PostPosted: July 3rd, 2011, 4:38 am 
Offline

Joined: July 1st, 2011, 1:42 am
Posts: 23
Thnks


Last edited by Tonak on July 3rd, 2011, 6:13 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2011, 4:57 am 
Offline

Joined: April 4th, 2008, 8:15 pm
Posts: 538
Location: Canada
Code:
If VarA>VarB
 Funct()
else
 Sleep 1


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2011, 6:18 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
purloinedheart wrote:
Code:
If VarA>VarB


As written, VarA is the name of a variable, who's contents will be inspected, and VarB is a literal value.

To compare the contents of 3 variables, you must use
Code:
If VarA>%VarB%
or
Code:
If (VarA>VarB)


for example
Code:
varA = 123
VarB = 122

If VarA>VarB ; <--- incorrect usage
msgbox larger
else
msgbox not larger ; <--- wrong result

If VarA>%VarB%
msgbox greater
else
msgbox not greater

If (VarA>VarB)
msgbox bigger
else
msgbox not bigger


If VarA>121 ; <--- correct usage
msgbox larger ; <--- correct result
else
msgbox not larger


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, chaosad, jrav, MSN [Bot] and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group