VoiceGuide IVR Software Main Page
Jump to content

Reading Date And Time

Recommended Posts

Our Voice Guide script is required to determine the current date, then speak this date in a Speak Numbers module. We're having trouble when the current month is only one digit (1 - 9), as the Speak Numbers module requires it to be two (01 - 09). We've got a module to determine if the current month is one or two digits, and another module to attach a leading zero in the single digit case. This module also has to piece together the various result variables containing the rest of the date information including the day and time. The resulting code in the modules is fairly cumbersome, and we were wondering if we were overlooking an easier way to do this. Here is an exerpt from our log:

 

-25140 5 [Current Month Check] Evaluate [($RV_MONTH<=9)]

-25140 5 RVreplace start: [($RV_MONTH<=9)]

-25140 5 RVreplace end: [(7<=9)]

-25140 5 .Eval((7<=9))

-25125 5 Eval Expr result:[True]

-25125 5 [Get Current Date] Evaluate [("0"+Cstr(($RV_MONTH*1000000)+($RV_DATE*10000)+($RV_HOUR*100)+($RV_MINUTE)))]

-25125 5 RVreplace start: [("0"+Cstr(($RV_MONTH*1000000)+($RV_DATE*10000)+($RV_HOUR*100)+($RV_MINUTE)))]

-25125 5 RVreplace end: [("0"+Cstr((7*1000000)+(21*10000)+(10*100)+(40)))]

-25125 5 .Eval(("0"+Cstr((7*1000000)+(21*10000)+(10*100)+(40))))

-25125 5 Eval Expr result:[07211040]

-25125 5 RVreplace start: [$RV[Entered Date]]

-25125 5 RVreplace end: [07211040]

-25125 5 [As Of] Say numbers: 07211040 as Date MMDDHHNN

-25125 5 fn PlaySoundStartNumbers asof.wav, validatedate.wav, 07211040, Date MMDDHHNN

-25125 5 twcal PlaySayNumber asof.wav, validatedate.wav, 07211040, , 23

-25093 5 PlaySoundStartNumbers ok

-18265 5 wb(-82512495)

-14593 5 wb(-82512494)

-14531 5 Play End line[5] (id=-825125)

-14531 5 LsSayNbrPlay EV_PLAY_FINISHED

-03625 5 LsSayNbrPlay EV_TIMEOUT_GOTOMODULE

 

The 'Current Month Check' module determines the number of digits in the current month, the 'Get Current Date' module pieces together the date information and adds the leading zero if required, and the 'As Of' module plays the date in between two sound files.

Any assistance in simplifying this process would be greatly appreciated.

Thank you very much.

 

John Cope

Medusa Research, Inc.

Share this post


Link to post

in version 5.0 you'll have a variabel called $RV_MM which gets the month in two digits format :)

Share this post


Link to post

i think so. i'm using email-module whech sends out warning email, when an error connecting to database occurs and attaches the actual trace log. the trace log has month and day in filename and month has twodigits format. i use server evaluate expression module to get the month in two-digits format.

 

with version 5 it should be much easier :)

Share this post


Link to post

The method posted in the first post of this thread is one of the cleanest ways of generating MMDDHHNN formated timestamp in v4.x.. that's why the new RVs are getting added in v5.0

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×