Page 1 of 1

Counter

Posted: Thu Sep 12, 2019 9:57 pm
by tommyhale@gmail.com
I need a task that will count elapsed days from a given date.

Re: Counter

Posted: Fri Sep 13, 2019 7:17 am
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"


Re: Counter

Posted: Fri Sep 13, 2019 7:20 am
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"


Re: Counter

Posted: Mon Sep 23, 2019 10:54 am
by Dragon Slayer
And how do you count days from the current date to a certain date in the future?

Re: Counter

Posted: Mon Sep 23, 2019 11:50 am
by Oleg
Look at 1-st example above