Find out the Week # in Month or last Week

Discuss RoboTask here
Post Reply
schluderjupp
Posts: 1
Joined: Tue Apr 26, 2005 7:05 am

Find out the Week # in Month or last Week

Post by schluderjupp »

I just finished this Script and thought maybe others might find it useful to find the week number in the Month or to find out if the date is the last weekday of the month. I hope there aren't too many bugs in it.
;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|0
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1"
Hide=INTEGER|0
ID=INTEGER|1139477380
Name=STRING|"Weekday - Weeknumber"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""WEEKNO"" with value ""0"""
Params=FOLDER
[Actions\Action1\Params]
expand=STRING|"0"
varname=STRING|"WEEKNO"
varvalue=STRING|"0"
[Actions\Action10]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"
[Actions\Action11]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Today is the {WEEKNO} {DayOfWeek} in the Month of {MonthName}"""
Params=FOLDER
[Actions\Action11\Params]
icon=STRING|"1"
msg0=STRING|"Today is the {WEEKNO} {DayOfWeek} in the Month of {MonthName}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action12]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action13]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""WEEKNO"""
Params=FOLDER
[Actions\Action13\Params]
varname=STRING|"WEEKNO"
[Actions\Action14]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""TODAY"""
Params=FOLDER
[Actions\Action14\Params]
varname=STRING|"TODAY"
[Actions\Action2]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER
[Actions\Action2\Params]
destvar=STRING|"TODAY"
line0=STRING|"07"
line1=STRING|"14"
line2=STRING|"21"
line3=STRING|"28"
line4=STRING|"35"
linecount=STRING|"5"
sourcetext=STRING|"1"
[Actions\Action3]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""WEEKNO"""
Params=FOLDER
[Actions\Action3\Params]
incement=STRING|"1"
vaiable=STRING|"WEEKNO"
[Actions\Action4]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action4\Params]
case=STRING|"0"
operator=STRING|"1"
type=STRING|"0"
value1=STRING|"{MonthIncDays(-{TODAY})}"
value2=STRING|"{MonthNo}"
[Actions\Action5]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"
[Actions\Action6]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action8]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then +7"
Params=FOLDER
[Actions\Action8\Params]
case=STRING|"0"
operator=STRING|"1"
type=STRING|"0"
value1=STRING|"{MonthIncDays(+7)}"
value2=STRING|"{MonthNo}"
[Actions\Action9]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Today is the last ({WEEKNO}th) {DayOfWeek} in the Month of {MonthName}"""
Params=FOLDER
[Actions\Action9\Params]
icon=STRING|"1"
msg0=STRING|"Today is the last ({WEEKNO}th) {DayOfWeek} in the Month of {MonthName}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"
 
Post Reply