Author Topic: Time token comparisons  (Read 2152 times)

jcdick1

  • Jr. Member
  • **
  • Posts: 59
Time token comparisons
« on: November 16, 2018, 09:08:09 PM »
I am not clear on what I'm missing that makes this not work:

When I say "Good afternoon"

Begin Condition : ([{TIMEHOUR24}] Is Greater Than Or Equals 12 AND [{TIMEHOUR24}] Is Less Than Or Equals 17)
    Say, 'Good afternoon'
Else If Integer Compare : [{TIMEHOUR24}] Is Greater Than 17
    Say, '[Its a little late for that. It's evening now' or 'good evening]'
Else If Integer Compare : [{TIMEHOUR24}] Is Less Than 12
    Say, '[It's morning,' or 'good morning,]'
End Condition

All I get is dead silence.  VA is acknowledging the command as recognized, but it says nothing.

Any help is appreciated.  Perhaps I am missing something needed for the conditional?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Time token comparisons
« Reply #1 on: November 16, 2018, 09:23:41 PM »
It's because {TIMEHOUR24} is a token (which is rendered as text where tokens are used) and not a variable.  Integer conditions use variable names.  You'll need to convert the value using the, 'Set an Integer Value' action with the, 'Convert Text/Token' option selected, with {TIMEHOUR24} as the input:

Set integer [myTime] value to the converted value of {TIMEHOUR24}

Then, replace all your, '{TIMEHOUR24}' conditions to, 'myTime'.

An additional, 'Else' by itself at the end would have played in this case.

Hope that helps some!