Author Topic: If Statement Block - Date/Time  (Read 1280 times)

Dzejk

  • Newbie
  • *
  • Posts: 2
If Statement Block - Date/Time
« on: June 15, 2020, 05:14:10 PM »
How ya doing bois?
I was playing around with "If" statements and tried to get something like a real time notifier - that would perhaps say "it's 8 am" or something - up and running but i couldn't get the Date/Time function quite right. I'm pretty confused by it, to be completely honest. Is there a way to only compare the time on its own - without the date? There's most likely something obvious to it but I just couldn't get it to work! :/

Ty for any feedback!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: If Statement Block - Date/Time
« Reply #1 on: June 15, 2020, 05:20:23 PM »
The "Date/Time" tab only allows checking against an absolute date/time value.

If you want to check a specific part of a date/time value, you'll want to use the "Text" tab combined with the appropriate token for the part you want to check.

E.G. to check whether it's currently Tuesday, you could do
Code: [Select]
Begin Text Compare : [{DATEDAYOFWEEK}] Equals 'Tuesday'
    Write [Blue] 'Yes, it is Tuesday' to log
End Condition

Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer; The "Text (and Text-To-Speech) Tokens" section lists the available date/time-related tokens.

Dzejk

  • Newbie
  • *
  • Posts: 2
Re: If Statement Block - Date/Time
« Reply #2 on: June 16, 2020, 04:30:07 PM »
So THAT's how it works. Thank you so much for the reply! :)