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 

A_Cursor Bug ?!?!

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
TMaier



Joined: 02 Feb 2005
Posts: 2

PostPosted: Wed Feb 02, 2005 3:49 pm    Post subject: A_Cursor Bug ?!?! Reply with quote

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
View user's profile Send private message
BoBo
Guest





PostPosted: Wed Feb 02, 2005 4:53 pm    Post subject: Reply with quote

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

PostPosted: Wed Feb 02, 2005 5:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
Guest






PostPosted: Wed Feb 02, 2005 5:30 pm    Post subject: Reply with quote

F... hell Shocked

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.

Cool
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Wed Feb 02, 2005 5:32 pm    Post subject: Reply with quote

You beat me Smile

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
View user's profile Send private message Send e-mail
BoBo
Guest





PostPosted: Wed Feb 02, 2005 6:01 pm    Post subject: Reply with quote

I had needed some testing to get aware of it Laughing

Maybe TMaier should be banned from the Forum for fooling us successfully (well, even for parts of a sec). Twisted Evil

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 Very Happy
Back to top
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Wed Feb 02, 2005 10:28 pm    Post subject: Reply with quote

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. Laughing
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Feb 03, 2005 8:56 am    Post subject: Reply with quote

Ups...ok these are my first steps in AHK Embarassed

maybe...thx to all


Whe see us another Day, with another Problem or Bug ! Twisted Evil
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports 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