Help with complex Calc

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
terencepjf
Newbie
Posts: 15
Joined: Wed Dec 19, 2007 9:16 pm

Help with complex Calc

Post by terencepjf » Thu Dec 20, 2007 12:06 pm

Hi; I'm new to Macro Scheduler and having trouble with complex expressions.

I need to get the coming Sunday's date:

This works: where result is DOW=5
Let>var={7 - %result%}
Let>var={%var% + 1}
VBEVal>DateAdd("d", %var%, Date),nextsunday
MessageModal>%nextsunday%

However, the complex expr does not:
Let>var={7 - %result% + 1}

Am I missing something?
Thanks in advance

User avatar
JRL
Automation Wizard
Posts: 3524
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Dec 20, 2007 3:11 pm

Works for me...

Code: Select all

VBSTART
VBEND

Let>result=5
//This works: where result is DOW=5
//Let>var={7 - %result%}
Let>var={7 - %result% + 1}
//Let>var={%var% + 1}
VBEVal>DateAdd("d", %var%, Date),nextsunday
MessageModal>%nextsunday%
Are you stepping through using F8 and the Watch List in the editor to watch the values of your variables?

terencepjf
Newbie
Posts: 15
Joined: Wed Dec 19, 2007 9:16 pm

Thanks

Post by terencepjf » Thu Dec 20, 2007 6:39 pm

Not sure what happened; you're right it works...

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