Counter

Discuss RoboTask here
Post Reply
tommyhale@gmail.com
Posts: 1
Joined: Sun Dec 31, 2017 7:33 pm

Counter

Post by tommyhale@gmail.com »

I need a task that will count elapsed days from a given date.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Counter

Post by Oleg »

Look at this example (see below)
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.

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
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task160"
Hide=INTEGER|0
ID=INTEGER|-285266320
LogOnAsUser=INTEGER|1
Name=STRING|"days left"
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
Action3=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""MYDATE"" with value ""{FormatToDateTime(20191101,yyyymmdd)}"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"1"
varname=STRING|"MYDATE"
varvalue=STRING|"{FormatToDateTime(20191101,yyyymmdd)}"

[Actions\Action2]
ActionID=STRING|"A_TIMEDIFFERENCE"
Enabled=INTEGER|-1
Name=STRING|"Time Difference"
Params=FOLDER

[Actions\Action2\Params]
datetime1=STRING|"{date}"
datetime2=STRING|"{MyDate}"
format=STRING|"3"
valuekind=STRING|"0"
varname=STRING|"delta"

[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{delta} days left to {MyDate}"""
Params=FOLDER

[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"{delta} days left to {MyDate}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

Oleg Yershov
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Counter

Post by Oleg »

Or this 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
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task190"
Hide=INTEGER|0
ID=INTEGER|-875444606
LogOnAsUser=INTEGER|1
Name=STRING|"elapsed 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
Action3=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""MYDATE"" with value ""{FormatToDateTime(20190801,yyyymmdd)}"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"1"
varname=STRING|"MYDATE"
varvalue=STRING|"{FormatToDateTime(20190801,yyyymmdd)}"

[Actions\Action2]
ActionID=STRING|"A_TIMEDIFFERENCE"
Enabled=INTEGER|-1
Name=STRING|"Time Difference"
Params=FOLDER

[Actions\Action2\Params]
datetime1=STRING|"{MyDate}"
datetime2=STRING|"{date}"
format=STRING|"3"
valuekind=STRING|"0"
varname=STRING|"delta"

[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{delta} days elapsed from {MyDate}"""
Params=FOLDER

[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"{delta} days elapsed from {MyDate}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

Oleg Yershov
Dragon Slayer
Posts: 1
Joined: Sun Sep 15, 2019 2:31 am
Contact:

Re: Counter

Post by Dragon Slayer »

And how do you count days from the current date to a certain date in the future?
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Counter

Post by Oleg »

Look at 1-st example above
Oleg Yershov
Post Reply