MS15 Inconsistent use of True TRUE False FALSE

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
user5274
Junior Coder
Posts: 43
Joined: Tue Aug 04, 2020 9:35 am

MS15 Inconsistent use of True TRUE False FALSE

Post by user5274 » Sat Aug 29, 2020 6:20 am

Because not all MS15 commands return a consistent TRUE/True or FALSE/False, is it safe to use a catch-all {TRUE}/{FALSE} to test for returns to MS15 commands?

For example, this command
WaitPixelColor returns TRUE or FALSE

while this command
IsConnectedToInternet returns True or False

So I don't have to remember when to use either is it safe to use:

Code: Select all

If>WPC_RESULT={TRUE}
or

Code: Select all

If>ISCONNECTED={FALSE}
throughout my code, or will i take a performance hit by forcing it into complex mode?

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

Re: MS15 Inconsistent use of True TRUE False FALSE

Post by Marcus Tettmar » Mon Aug 31, 2020 2:19 pm

Will make a note of that. Should really be consistent.

These are actually strings as far as MacroScript is concerned so safest thing would be:

If>{Upper(%WPC_RESULT%)="TRUE"}
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

user5274
Junior Coder
Posts: 43
Joined: Tue Aug 04, 2020 9:35 am

Re: MS15 Inconsistent use of True TRUE False FALSE

Post by user5274 » Mon Aug 31, 2020 7:45 pm

Great thank you!

I personally know now which commands return what, I just had a partner that decided to "clean up" the code and changed all the "booleans" to uppercase and thats when IsConnected (and another command) broke, drove me crazy for the better part of the day. :)

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