Jump to content
Macro Express Forums

Mouse drag causes syntax error


Recommended Posts

Hi All, I am trying to hold my left mouse button down and drag if a condition is met. The below code causes the Editor to complain about Syntax Errors:

 

 

If Variable %xVal% Is Greater Than "100"
Mouse Left Button Down
Mouse Move: %xx%, %yy% Relative to Screen
End If
Notice that the editor indents the "End If" , so clearly it is getting confused.
What, if anything am I doing incorrectly and how do I implement a mouse drag if a condition is met, without producing a syntax error?
(Here is the actual code as requested)
<IF VARIABLE Variable="%xVal%" Condition="\x03" Value="100" IgnoreCase="FALSE"/>
<MOUSE LEFT BUTTON DOWN/>
<MOUSE MOVE Option="\x01" X="%xx%" Y="%yy%" _PROMPT="0x000A"/>
<END IF/>
Link to comment
Share on other sites

If Variable %xVal% Is Greater Than "100"
  Mouse Left Button Down
   Mouse Move: %xx%, %yy% Relative to Screen
  Mouse Left Button Up
End If

Add the Mouse Left Button Up line.

 

 

 

That defeats the whole purpose of the drag because if I use the "Mouse button up" and I am still on the same area of the screen it, then counts as a mouse click which has a completely different action associated with it.

 

Edit: Having said that I will try it out and see - perhaps I can do multiple drags, each with its own mouse down and mouse up, without them been considered mouse clicks by the application - I will let you guys know.

Link to comment
Share on other sites

Within MXPro, the Button Down / Button Up commands are a code structure same as the If / End If and the Repeat / End Repeat structures. You will receive the same syntax error message when any part of any code structure is missing.

Link to comment
Share on other sites

Within MXPro, the Button Down / Button Up commands are a code structure same as the If / End If and the Repeat / End Repeat structures. You will receive the same syntax error message when any part of any code structure is missing.

 

Yes it does seem so. It is irritating as a mousedown should not have an enforced mouseup. I might have perfectly good reasons for never releasing a mouse button and it shouldn't be up to the language to try enforce how I use my mouse! As it stands now, I have to release the mouse button within the same block of code - or suffer Syntax error warnings. Not happy.

 

In any case it does not effect the logic and the program runs perfectly ok , just every time I save it I get warned about the syntax error. I know I can disable the warning but want to keep it for a "real" syntax error!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...