VoiceGuide IVR Software Main Page
Jump to content

Vbscript Questions

Recommended Posts

Daniel wrote:

 

Do you have any idea why vbscript's returned value

for Cos would be different than the rest of the world's?

 

When I use a calculator, online, microsoft's, or traditional, I get

Cos(.59722) = .99994

 

However, voiceguide is receiving Cos(.59722)=.89670 (I rounded the values

involved)

 

I verified that it was the Cos function that was causing this to happen. I

verified that the values going into the Cos function were what they should

be.

 

Would you have any idea why this would happen? Perhaps you know of a way to

test the value outside of voiceguide? I don't think the trace would be of

any value because once the vbscript starts, it doesn't seem to leave any

traces other than it's entry and exit.

Share this post


Link to post

The Microsoft calculator takes COS input in Degrees, while VBScript takes input in Radians.

 

Radian = Angle * 3.14159265 / 180.0

 

a sample test VBScript showing this is attached - just download and double-click it and the script will run.

 

The VBScript's that VoiceGuide runs are available for viewing as well. See bottom of the Help file's page on VBScript module. ( online copy here: http://www.voiceguide.com/vghelp/html/modVbs.htm )

CosTest.vbs

Share this post


Link to post

Ok, I see. Doh, that was dumb of me. So I was getting the right value in vbscript because I had already converted it to radians, thinking that's what the world used.

Share this post


Link to post

WOW! Someone using a trigonometry in a CTI script !! Awesome. ;-)

 

And qudos to support for spotting radian base - cool !!

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
×