help variabile

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
luca1974wow
Newbie
Posts: 15
Joined: Sat Dec 12, 2009 11:20 pm

help variabile

Post by luca1974wow » Wed Dec 16, 2009 5:13 pm

This is my macro and it work fine

GetPixelColor>1420,1,VARIABILE
If>VARIABILE=0
Send>the color is black
endif
------------------------------------

but i want that macro work

GetPixelColor>1420,1,VARIABILE
If>VARIABILE=0 or 1000 or 5000
Send>the color is black or green or yellow
endif

i write or because i don't know the exact simbol for this macro

what is the just simbol?


(sorry for my english)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Dec 16, 2009 5:16 pm

If>{(%VARIABILE%=0) or (%VARIABILE%=1000) or (%VARIABILE%=5000)}
...
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Dec 16, 2009 10:09 pm

Hi Marcus and all,

Just a side note... and I know this has been said before... but I believe questions like this keep coming in because there are too few examples in the Help File on how to use Complex Expressions and the proper syntax with using the round brackets () and the braces {}.
A topic (page) we have now in the Help File wrote:Complex Expression Examples

Numeric Functions:

Let>r={round(34.6)}
Let>ans={cos(340)}

Using numeric variables in complex expressions we enclose variables in % symbols:

Let>r=34.6
Let>r={round(%r%)}

String Functions:

In Complex expressions string literals must be enclosed in double quotes ("). Variables are just enclosed with % symbols:

Let>email=[email protected]
Let>at={Pos("@",%email%)}

Here at equals 5 as it is the 5th character in [email protected]

Let's now use the copy function to extract everything before the @ sign:

Let>namepart={copy(%email%,1,%at%-1)}

Conditional Functions:

Let>email=[email protected]
Let>IsItAnEmail={if(pos("@",%email%)>0,"yes","no")}

Of course we could do:

Let>email=[email protected]
Let>at={Pos("@",%email%)}
Let>IsItAnEmail={if(%at%>0,"yes","no")}

Here IsItAnEmail would be set to "yes".
I get that for the whole expression to be treated as a complex expression, you surround the whole thing in braces {} from the Help file page below... but it mentions nothing about when you must use round brackets ():
Another topic (page) we have now in the Help File wrote:Complex Expressions

Syntax

In Macro Scheduler all complex functions should be contained within curly braces ("{" and "}"). Variables should be enclosed within % symbols and literal strings should be enclosed within double quotes ("). Parameters are separated by commas (,).

Complex expressions are supported in Macro Scheduler's IF statements and LET statement, and since version 9.0 can now also be included within all other commands and function calls in the place of regular variables.

Operators

Arithmetic Operators
Logical Operators
String Operators
Relational Operators

Functions

Arithmetic Functions
String Functions
Conditional Expressions

Examples

Complex Expression Examples
If there were at least one example of the proper use of all the Operators and Functions then users would probably catch on quicker. For example, I don't see any Logical examples of the type you just provided in your answer to this post:
mtettmar wrote:If>{(%VARIABILE%=0) or (%VARIABILE%=1000) or (%VARIABILE%=5000)}
...
Endif
Marcus, please do not take this as complaining... as I am a happy customer and the support here has always been first rate.

I'm just stating my opinion that in some cases (like this one), a few more examples in the Help File would be... helpful.

Keep up the great work and take care.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts