Tomorrow's {DayOfWeek} Variable

Discuss RoboTask here
Post Reply
george
Posts: 25
Joined: Sun Mar 25, 2018 3:02 pm

Tomorrow's {DayOfWeek} Variable

Post by george »

Hi, how can I get a variable of tomorrow's {DayOfWeek}?
For example if today is wednesday then the {Tomorrow} variable would be "thursday".

Thanks
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Tomorrow's {DayOfWeek} Variable

Post by Oleg »

Now you can use VB Evaluate action

Also look at my example 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|1040932817
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task476"
Hide=INTEGER|0
ID=INTEGER|2145604004
LogOnAsUser=INTEGER|1
Name=STRING|"Get week day name by date"
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|"GetDayOfWeek(""{DateIncDays(1)}"")"
line00000000=STRING|"function GetDayOfWeek(strDate)"
line00000001=STRING|"  dt = cstr(strdate)"
line00000002=STRING|"  wno = Weekday(dt)"
line00000003=STRING|"  GetDayOfWeek = WeekdayName(wno)"
line00000004=STRING|"end Function"
line00000006=STRING|"'logmessage(GetDayOfWeek(""27.01.2022""))"
linecount=STRING|"7"
loadfromfile=STRING|"1"
variable=STRING|"dname"

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

[Actions\Action2\Params]
icon=STRING|"1"
msg0=STRING|"{dname}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

Oleg Yershov
george
Posts: 25
Joined: Sun Mar 25, 2018 3:02 pm

Re: Tomorrow's {DayOfWeek} Variable

Post by george »

Works perfect, thanks Oleg!
Post Reply