Hints, tips and tricks for newbies
Moderators: Dorian (MJT support), JRL
-
user5274
- Junior Coder
- Posts: 43
- Joined: Tue Aug 04, 2020 9:35 am
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:
or
throughout my code, or will i take a performance hit by forcing it into complex mode?
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
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"}
-
user5274
- Junior Coder
- Posts: 43
- Joined: Tue Aug 04, 2020 9:35 am
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.