AutoHotkey Community

It is currently May 27th, 2012, 10:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: September 18th, 2006, 10:06 am 
Offline

Joined: May 22nd, 2006, 2:01 pm
Posts: 25
Hi everyone,

I have a problem with my code. Let's see if anyone can help me.
My code is the following:

^1::

x = `r`n
y = y`r`n
clipboard=
send, ^c
clipwait

if ( x = %clipboard% or y = %clipboard% )
{
msgbox, found !!!
}
return


The system gives me the message

Error this variable or function name contains an illegal caracter. The current thread will exit. Specifically:

line#
.
.
.
022: if ( x = %clipboard% or y = %clipboard% )
.
.
.

What does this mean. Anyone has an idea why the error occurs?

Regards

Oli


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2006, 10:12 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
please remove the "%" and try again.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2006, 10:18 am 
Offline

Joined: May 22nd, 2006, 2:01 pm
Posts: 25
Hi toralf,

thanks for the fast answer. The problem was exactly this.

For me it seems a little bit strange that sometimes you have to use the % and then in an if case you don't have to use them. Do you know why it is like this?

Regards

Oli


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2006, 11:51 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Yes ;)

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2006, 12:12 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
If expression vs. "old-style" If... See doc. for this. Might change in a future v.2, as Chris acknowledges it is a bit confusing...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 18th, 2006, 1:28 pm 
Offline

Joined: May 22nd, 2006, 2:01 pm
Posts: 25
Ok, fine!


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Maestr0 and 59 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