VoiceGuide IVR Software Main Page
Jump to content

Eval Length Of Input

Recommended Posts

I have an eval module that checks the length of input from the previous module.

 

The Play_1005_GetNumber Module captures a number which is 5 digits or less.

 

The evaluation is:

len($RV[Play_1005_GetNumber]) < 5

 

It works perfectly UNLESS the entered number starts with a zero, then, even if it is 5 digits in length, it causes the evaluation to always be True. I have confimed this by looking at the .vgl file for this script.

 

The only thing I can think of is that I am using the wrong evaluation expression. What do you suggest?

Share this post


Link to post

Make $RV[Play_1005_GetNumber] a string when your are setting the results variable, then you can have leading zeros just fine.

Share this post


Link to post

It is already a string, I think.

 

The rv is stored in the log file with a leading zero and when I use it later in the script to do a database lookup, the leading zero is there.

Share this post


Link to post

len("$RV[Play_1005_GetNumber]") < 5

 

note the double quotes around the RV... that makes the len function evaluate the input as a string...

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
×