Hello Oleg,
What do i have to change to set the week number minus 1 by the variable ; {WeekOfTheYear({Date})}
And at what day does the new week start? Is it on monday?
Kind regards,
Maurice
Weeknumber minus 1
Weeknumber minus 1
Robotask rules! 

Re: Weeknumber minus 1
New week begins on Monday.
See the example below how to calculate WeekOfTheYear-1
See the example below how to calculate WeekOfTheYear-1
Code: Select all
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task730"
Hide=INTEGER|0
ID=INTEGER|73766993
LogOnAsUser=INTEGER|1
Name=STRING|"Week of the year - 1"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""WEEKNUM"" with value ""{WeekOfTheYear({Date})}"""
Params=FOLDER
[Actions\Action1\Params]
expand=STRING|"1"
varkind=STRING|"1"
varname=STRING|"WEEKNUM"
varvalue=STRING|"{WeekOfTheYear({Date})}"
[Actions\Action2]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""WeekNum"""
Params=FOLDER
[Actions\Action2\Params]
incement=STRING|"-1"
vaiable=STRING|"WeekNum"
[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""[{Time}, {DayOfWeek}, {Date}]"""
Params=FOLDER
[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"[{Time}, {DayOfWeek}, {Date}]"
msg1=STRING|"Week of the Year: {WeekOfTheYear({Date})}"
msg2=STRING|"Week of the Year - 1: {WeekNum} "
msgcount=STRING|"3"
playsound=STRING|"0"
showmessage=STRING|"1"
Oleg Yershov
Re: Weeknumber minus 1
What do you want to get: yesterday's date or number of previous week?
{IncDays(-1)} - the day number (not week number or date)
{DateIncDays(-1)} - the date of yesterday
{IncDays(-1)} - the day number (not week number or date)
{DateIncDays(-1)} - the date of yesterday
Oleg Yershov
Re: Weeknumber minus 1
Where to use the code when I want to use the variable? Should I copy the code to "Local variables"???
Re: Weeknumber minus 1
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.Where to use the code when I want to use the variable? Should I copy the code to "Local variables"???
You can see the task and use task editor to edit it and see all parameters of each step
Oleg Yershov