Exclude dates?
Exclude dates?
Essentially, I would like to be able to schedule certain processes to run only on days the US Stock Markets are open. I wouldn't expect the software to know the holidays necessarily, but giving me the ability to input the days I do not want the process to run would be nice. I assume, I could create and array of the weekeday holidays the process shouldn't be run on and put an additional check before the program is executed to determine if it's a holiday, based on my array of weekday holiday dates?
Last edited by gooser60 on Mon Mar 19, 2007 4:57 pm, edited 1 time in total.
Exclude dates?
Excuse me, I don't understand your question. Do you want to know how to make this check?
Exclude dates?
I was more saying that it would be nice when setting up a schedule task to say have the ability to exclude certain dates.
If it is possible for you to quickly show me how to do this that would be great.
If it is possible for you to quickly show me how to do this that would be great.
Re: Exclude dates?
See this example (see below):
You can create the list of holidays and simply stop the task if today is holiday date.
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
You can create the list of holidays and simply stop the task if today is holiday date.
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|444033236
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task88"
Hide=INTEGER|0
ID=INTEGER|1750422847
LogOnAsUser=INTEGER|1
Name=STRING|"exclude holidays"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""HOLIDAYS"" with value ""01-01-2016{EOL}08-01-2016{EOL}24-08-2016"""
Params=FOLDER
[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"HOLIDAYS"
varvalue=STRING|"01-01-2016{EOL}08-01-2016{EOL}24-08-2016"
[Actions\Action2]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action2\Params]
case=STRING|"0"
operator=STRING|"6"
type=STRING|"0"
value1=STRING|"{DateTimeToFormat({Date},dd-mm-yyyy)}"
value2=STRING|"{holidays}"
[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Today is holiday. Exiting."""
Params=FOLDER
[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"Today is holiday. Exiting."
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action4]
ActionID=STRING|"A_FLOW_EXIT"
Enabled=INTEGER|-1
Name=STRING|"Exit"
[Actions\Action5]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action6]
ActionID=STRING|"A_ROBOTASK_ALERT"
Enabled=INTEGER|-1
Name=STRING|"Show Notification"
Params=FOLDER
[Actions\Action6\Params]
defh=STRING|"1"
defw=STRING|"1"
duration=STRING|"5"
height=STRING|"76"
icon=STRING|"3"
kind=STRING|"0"
message=STRING|"Place your actions here"
position=STRING|"3"
title=STRING|"Normal working"
width=STRING|"330"
Oleg Yershov
-
- Posts: 46
- Joined: Tue Mar 28, 2017 3:05 pm
Re: Exclude dates?
Hi,
Can this task be used by other tasks without having to insert this logic into every task that is scheduled? I was able to import this task as instructed but it appears to be on its own. I will have many tasks that are scheduled and would like to be able to stop running them all if it falls on a holiday or weekend.
Thanks!
Can this task be used by other tasks without having to insert this logic into every task that is scheduled? I was able to import this task as instructed but it appears to be on its own. I will have many tasks that are scheduled and would like to be able to stop running them all if it falls on a holiday or weekend.
Thanks!
Re: Exclude dates?
You can save holiday dates in the separate text file and use it in your task.
One date per line.
system variable TextFile can read the text file
Use the expression {TextFile(file_name)}
One date per line.
system variable TextFile can read the text file
Use the expression {TextFile(file_name)}
Oleg Yershov