If statement quirk or am I having a senior moment again ?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
SuitedAces
Pro Scripter
Posts: 50
Joined: Thu Feb 21, 2008 9:11 pm

If statement quirk or am I having a senior moment again ?

Post by SuitedAces » Fri Mar 07, 2008 8:02 pm

Code: Select all

Let>NumOfUsers=False
Let>MinNumberOfUsers=5

If>%NumOfUsers%=False
Ask>no users,continue
If>%continue%=NO
Exit>0
EndIf
Endif

If>%NumOfUsers%<MinNumberOfUsers>not enough users,continue
If>%continue%=NO
Exit>0
EndIf
EndIf


If>{(%NumOfUsers%=False)OR(%NumOfUsers%<MinNumberOfUsers>no users, or not enough users
Else
Message>user count is good
EndIf  
Set the NumOfUsers to either False or a number.

The 'False' is not working in the complex If statement
But it works by itself in the first If .
Last edited by SuitedAces on Fri Mar 07, 2008 8:09 pm, edited 2 times in total.

SuitedAces
Pro Scripter
Posts: 50
Joined: Thu Feb 21, 2008 9:11 pm

Post by SuitedAces » Fri Mar 07, 2008 8:05 pm

Again my code is getting scrambled when I paste it.

LOL

Let me fix it first.

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

Post by Marcus Tettmar » Fri Mar 07, 2008 8:10 pm

False is actually a string. In MacroScript there are just strings and numbers.

So if you move to using a complex expression, which requires strings in quote delimiters you must do:

If>{(%NumOfUsers%="False") OR .....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

SuitedAces
Pro Scripter
Posts: 50
Joined: Thu Feb 21, 2008 9:11 pm

Post by SuitedAces » Fri Mar 07, 2008 8:15 pm

Ok thank you I will try that.

It is frustrating to learn that False works in a regular If statement but not in a complex If statement.

Did I miss some small print in the help, is it in help?

This inability to paste code with out it getting scrambled drives me nuts .
Maybe taking a screenshot is better and less aggravating.

SuitedAces
Pro Scripter
Posts: 50
Joined: Thu Feb 21, 2008 9:11 pm

Post by SuitedAces » Fri Mar 07, 2008 8:20 pm

Ok I see that it will take FALSE in all caps but the complex If statement will not take False.

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