I am trying to use the date variables to label a folder / file in the format YYYY MMM DD for yesterday's date. I see that you have provided variables that enable the date and day for yesterday to be determined, but the only month variable appears to be the numeric number option as opposed to the shortname option.
Is there any way to get yesterdays month in MMM (e.g. DEC) format. Alternatively, can I use a variable as an array pointer and if so, how? Finely, If I have to write a process of 12 IF-THEN-ELSE commands, can I setup a task solely for this function, and call it from other tasks?
Yesterday in YYYY MMM DD format
Yesterday in YYYY MMM DD format
You are right. Date&Time macrofunctions (IncDays family) of RoboTask can retrieve values as numeric value only.
Now you can use Evaluate action. In order to get a short month name of yesterday evaluate the expression MonthName(Month(DateAdd("d",-1,Date())),true). Also BASIC plugin contains BASIC script action and detailed help for BASIC language. In BASIC script you can access to RoboTask's variables and tasks.
Another way:
Create a variable named MyMonths (for example) which contain the string: "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC" .
In order get the some name you should use expression MyMonths(n) where n is a month number from 0 to 11. If you want begin numeration from 1 put any string begore JAN. For example "BUF,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC".
Now you can write {MyMonths({MonthIncDays(-1)})}
There is more simple way. You can download free BASIC plugin for Robotask and install it.Is there any way to get yesterdays month in MMM (e.g. DEC) format. Alternatively, can I use a variable as an array pointer and if so, how? Finely, If I have to write a process of 12 IF-THEN-ELSE commands, can I setup a task solely for this function, and call it from other tasks?
Now you can use Evaluate action. In order to get a short month name of yesterday evaluate the expression MonthName(Month(DateAdd("d",-1,Date())),true). Also BASIC plugin contains BASIC script action and detailed help for BASIC language. In BASIC script you can access to RoboTask's variables and tasks.
Another way:
Create a variable named MyMonths (for example) which contain the string: "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC" .
In order get the some name you should use expression MyMonths(n) where n is a month number from 0 to 11. If you want begin numeration from 1 put any string begore JAN. For example "BUF,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC".
Now you can write {MyMonths({MonthIncDays(-1)})}
Last edited by Oleg on Tue Dec 21, 2004 12:04 pm, edited 1 time in total.
-
- Posts: 9
- Joined: Mon Dec 20, 2004 12:33 pm
Yesterday in YYYY MMM DD format
Tanks - This is ideal for my needs being a very experienced programmer.
Keep up the great work with a great product.
Keep up the great work with a great product.