| View previous topic :: View next topic |
| Author |
Message |
TMaier
Joined: 02 Feb 2005 Posts: 2
|
Posted: Wed Feb 02, 2005 3:49 pm Post subject: A_Cursor Bug ?!?! |
|
|
Hello,
i have a Problem with A_Cursor . Sombody now why my Script not show the msgbox ???
| Code: | SplashImage,, x0 y904 w300 H120 ctFFFFFF cwFF00FF,, %A_Space%,Information
WinSet, Trans, 200, Information
SetDefaultMouseSpeed, 0
SetKeyDelay, 1
Sleep,500
SetTimer, VarView, 50
loop ,10000
{
Sleep,100
Var1 = %A_Cursor%
Var2 = %A_Index%
If Var1 = Arrow then
{
msgbox Arrow
break
}
}
VarView:
ControlSetText, Static1, Loop : %Var2%, Information
ControlSetText, Static2, Var1= %Var1%, Information
Return |
|
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Feb 02, 2005 4:53 pm Post subject: |
|
|
| Maybe the system is busy (eggtimer/WAIT ?) cause you're looping indefinitely. So it won't reach the status of being idle !? |
|
| Back to top |
|
 |
TMaier
Joined: 02 Feb 2005 Posts: 2
|
Posted: Wed Feb 02, 2005 5:14 pm Post subject: |
|
|
The only Problem is :
A_Cursor is Arrow also Var1 is Arrow, but the "If" Statement not work.
EDIT
I have found a Workaround:
donīt work
| Code: |
Var1 = %A_Cursor%
Var2 = Arrow
if Var1 = %Var2% then
{
msgbox Arrow
break
}
|
this works
| Code: |
Var1 = %A_Cursor%
Var2 = Arrow
IfInString, Var1, %Var2%
{
msgbox Arrow
break
}
|
|
|
| Back to top |
|
 |
Guest
|
Posted: Wed Feb 02, 2005 5:30 pm Post subject: |
|
|
F... hell
If Var1 = Arrow then ; your var1 is named "Arrow then"
Therefore it will never match with "Arrow" !
There is (currently) no then condition in AHK.
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Wed Feb 02, 2005 5:32 pm Post subject: |
|
|
You beat me
At first I couldn't see the problem because the word "then" is so natural when used with "if". But the word "then" is in fact the problem. It should not be used with if-statements because it would be considered part of the string. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Feb 02, 2005 6:01 pm Post subject: |
|
|
I had needed some testing to get aware of it
Maybe TMaier should be banned from the Forum for fooling us successfully (well, even for parts of a sec).
No. No, Mr. Maier. Calm down, I was just kidding. We're always happy to welcome a new member to the "AHK rulez the world"-community  |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Wed Feb 02, 2005 10:28 pm Post subject: |
|
|
I think BoBo's the one who should be expelled; he almost let our little secret slip with his "rulez the world" comment.
I mean... uh, what? I didn't say anything.  |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Feb 03, 2005 8:56 am Post subject: |
|
|
Ups...ok these are my first steps in AHK
maybe...thx to all
Whe see us another Day, with another Problem or Bug !  |
|
| Back to top |
|
 |
|