AutoHotkey Community

It is currently May 26th, 2012, 7:36 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: July 6th, 2005, 7:35 pm 
Offline

Joined: August 30th, 2004, 11:30 pm
Posts: 10
The command below worked perfectly prior to version 10.36.02 but now it has the error listed below.
I believe your fix that Disallowed linefeeds (`n) and other invisible characters in variable names
somehow thinks it is part of the name.

If (A_LoopField=`n OR A_LoopField=`r`n)


ERROR MESSAGE
---------------------------
AutoILMQuoteSheet.ahk
---------------------------
Error at line 6495.

Line Text:

Error: This variable or function name contains an illegal character.

The program will exit.
---------------------------
OK
--------------------------

Any help would be appreciated


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 6th, 2005, 10:03 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
hi , your if statement is an expression, so all name in the () are vars, except the text in "".

So:
If (A_LoopField=`n OR A_LoopField=`r`n)

AHK thinks `n and `r`n are vars

You should Do
If (A_LoopField="`n" OR A_LoopField="`r`n")

*Not tested*

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2005, 12:11 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Although it didn't yield a syntax error in the previous version, the fact that it worked at all was unintentional. As Toralf pointed out, each literal string in an expression should be enclosed in quotes.

Sorry for the inconvenience.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2005, 4:34 pm 
Just for verification...if the value is a number it can be used WITHOUT quotes??

IF (X=1 or Y=1)

Is this correct?

Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2005, 5:28 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
yep, numbers are the only exeption.

Actually, in that special case it would be enough to write

IF (X or Y)

If it would be ok if x or y are greater or equal then 1.

_________________
Ciao
toralf
Image


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey and 4 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