Page 1 of 1

Increment general date

Posted: Fri Sep 29, 2017 8:04 pm
by marcolobaido
Hi, I need to increment a variable {DATE1} = 31/08/2017

There's a way to do it in a simple way like {DateIncDays(+1)} ?

Re: Increment general date

Posted: Fri Sep 29, 2017 8:40 pm
by Oleg
You can do this with VB Evaluate action
VB script contains function DateAdd ( see description here )

Look at my example

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1360203151
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task149"
Hide=INTEGER|0
ID=INTEGER|1026093259
LogOnAsUser=INTEGER|1
Name=STRING|"inc days"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER

[Actions\Action1]
ActionID=STRING|"A_SCRIPT_VBEVALUATE"
Enabled=INTEGER|-1
Name=STRING|"VB Evaluate"
Params=FOLDER

[Actions\Action1\Params]
expression=STRING|"DateAdd(""d"",20,""{date}"")"
linecount=STRING|"0"
loadfromfile=STRING|"1"
variable=STRING|"NewDate"

[Actions\Action2]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{Date}"""
Params=FOLDER

[Actions\Action2\Params]
icon=STRING|"1"
msg0=STRING|"{Date}"
msg1=STRING|"{NewDate}"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.

Re: Increment general date

Posted: Sat Sep 30, 2017 9:12 am
by marcolobaido
thank you!