// Pointer Location and Pixel Color when CTRL-P is typed
GETCURSORPOS> X,Y
GETPixelCOLOR>X,Y,Color
MessageModal>X,%X%,Y,%Y%, Color,%Color%
If a leading blank is present when X is defined, a message will show the variable name (X) where the value should be.
Message Display after CTRL-P = X,%X%,Y,581, Color,14265756
Getting rid of the blank following "GETCURSORPOS>" fixes this problem however the value of X is correct and usable in expressions even when the display problem is present.
I am using Macro Scheduler 10.1.02 with XP SP3
Whitespace Variable Display Problem
Moderators: Dorian (MJT support), JRL
-
- Newbie
- Posts: 6
- Joined: Sun Nov 18, 2007 8:23 pm
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Macro Scheduler recognizes spaces as "real" characters. They can not be used as delimiters, or space to make easier reading.
Let> x is not the same as Let>x.
This is true, anywhere on the line, escpecilly common error around equal signs.
Let>a = 15 is not the same as Let>a=15, and Let>a= 15 is also different.
Initially you may find this a problem, but will soon come to value the benefits of the literal variables.
Let> x is not the same as Let>x.
This is true, anywhere on the line, escpecilly common error around equal signs.
Let>a = 15 is not the same as Let>a=15, and Let>a= 15 is also different.
Initially you may find this a problem, but will soon come to value the benefits of the literal variables.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
You should also look into the use of IGNORESPACES. This setting will allow you to use spaces in some instances with no change in the value.
This is right out of the help file
By default, spaces are seen as regular characters and are included in variable assignments. E.g. The following line..
Let>a = 5
.. would create a variable called "a " with the value " 5".
Normally, therefore, you should use:
Let>a=5
But experienced programmers are used to the language ignoring spaces. This can be achieved by setting IGNORESPACES to 1:
Let>IGNORESPACES=1
Let>a = 5
This would set variable "a" to the value 5.
This is right out of the help file
By default, spaces are seen as regular characters and are included in variable assignments. E.g. The following line..
Let>a = 5
.. would create a variable called "a " with the value " 5".
Normally, therefore, you should use:
Let>a=5
But experienced programmers are used to the language ignoring spaces. This can be achieved by setting IGNORESPACES to 1:
Let>IGNORESPACES=1
Let>a = 5
This would set variable "a" to the value 5.
-
- Newbie
- Posts: 6
- Joined: Sun Nov 18, 2007 8:23 pm
Whitespace
Thanks for the IGNORESPACES suggestion. I will begin using it.
There still seems to be a problem with consistency because
GETCURSORPOS> X,Y
GETPixelCOLOR> X,Y,Color
MessageModal> X,% X%,Y,%Y%,Color,%Color%
has the same display error as when I tried to display %X%...that is the message shows the variable name instead of the value even if I use " X" everywhere.
There still seems to be a problem with consistency because
GETCURSORPOS> X,Y
GETPixelCOLOR> X,Y,Color
MessageModal> X,% X%,Y,%Y%,Color,%Color%
has the same display error as when I tried to display %X%...that is the message shows the variable name instead of the value even if I use " X" everywhere.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Whitespace
You have a space here: % X%. The line should be:Willaim Mitchell wrote:Thanks for the IGNORESPACES suggestion. I will begin using it.
There still seems to be a problem with consistency because
GETCURSORPOS> X,Y
GETPixelCOLOR> X,Y,Color
MessageModal> X,% X%,Y,%Y%,Color,%Color%
has the same display error as when I tried to display %X%...that is the message shows the variable name instead of the value even if I use " X" everywhere.
MessageModal> X,%X%,Y,%Y%,Color,%Color%
i.e. to use variables within strings they must have % symbols around them, with no spaces between the % symbols and the variable name.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?