Hello, can someone offer some insight into my problem?
My pseudo code is to accomplish the following:
If day_of_week = Monday then
variable = abc
If day_of_week = Tuesday then
variable = def
etc....
Is this possible without calling up some external ini/txt file? Or...?
Thanks in advance.
Day Of The Week
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
If not already doing it, may I suggest using:
But I would remove the leading spaces before the labels from his quick and dirty sample.
Then continue with lumumba's good script sample.DayOfWeek>day_of_week
But I would remove the leading spaces before the labels from his quick and dirty sample.
And finally, be sure to remove any trailing spaces from lines if doing a cut/paste from the forum samples.If>day_of_week=Monday,DOWMon
If>day_of_week=Tuesday,DOWTue
...
...
Label>DOWMon
Let>var=abc
Goto>DOWDone
Label>DOWTue
Let>var=def
Goto>DOWDone
...
...
Label>DOWDone
MessageModal>variable for %day_of_week% = %var%
Last edited by Bob Hansen on Wed Apr 14, 2004 8:34 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Thanks to the both of you for the help. However, in the code's present state, after all the If statements, the code runs through the first label and then jumps to the MessageModal at the end. The variable will always contain Monday's value. It appears that any code following labels are executed irregardless of If statements.
Any ideas? Thanks again.
Any ideas? Thanks again.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Sorry, I think we have been trying to provide code snippets to give you a structure, a concept, and a headstart. Tough to write all the code for all requests.
Here is a more detailed structure with snippets. Perhaps it would be more helpful if it looked like this:
Here is a more detailed structure with snippets. Perhaps it would be more helpful if it looked like this:
Also note that labels and variables are Case Sensitive.DayOfWeek>day_of_week
//Insert lines here for each day of week
If>%day_of_week%=Monday,DOWMon
If>%day_of_week%=Tuesday,DOWTue
...
...
If>%day_of_week%=Sunday,DOWSun
//Copy three lines below for each day of week, modifying Label and var value as necessary
Label>DOWMon
Let>var=abc
Goto>DOWDone
Label>DOWTue
Let>var=def
Goto>DOWDone
...
...
...
//Continue macro script from here
Label>DOWDone
MessageModal>variable for %day_of_week% = %var%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!