VoiceGuide IVR Software Main Page
Jump to content

Calculating And Operators

Recommended Posts

How to use for example "ROUND (var/1000;0)" in evaluate expression to get result as $RV[AB] ??

Share this post


Link to post

The result of the evaluated expression is automatically stored in the $RV[module_title]

 

eg: If your evaluate expression module is named DoSomeCalc then the created $RV will be $RV[DoSomeCalc]

 

You are able to see in the vgEngine traces what $RVs are created and what their values are.

 

Please post vgEngine trace (.ZIPed) and script if you still have any questions.

Share this post


Link to post

from logs:

 

141135,29 2 state [calculate_ABSPQ] Evaluate [ROUND($RV[calling_number]/10000;0)]

141135,29 2 rv replace start: [ROUND($RV[calling_number]/10000;0)]

141135,29 2 rv replace end: [ROUND(523602095/10000;0)]

141135,29 2 eval[ROUND(523602095/10000;0)]

141135,29 2 Error: 1006

141135,29 2 rv add [calculate_ABSPQ_Input]{ROUND(523602095/10000;0)}

141135,29 2 rv add [calculate_ABSPQ]{ROUND(523602095/10000;0)}

141135,29 2 rv add [ABSPQ]{ROUND(523602095/10000;0)}

141135,29 2 Eval Expr result:[ROUND(523602095/10000;0)] stored in $RV[ABSPQ]

141135,29 2 path {ROUND(523602095/10000;0)} not found

141135,29 2 matching path not found

 

How to use functions like "ROUND" in Evaluation Expression module listed: http://www.voiceguide.com/vghelp/source/html/modevalexpr.htm ?

 

I wrote in Expression to evaluate: ROUND($RV[calling_number]/10000;0)

save as Variable: ABSPQ

 

 

When i used "$RV[calling_number]\10000" it works, but in other place i need ROUND function (non integer result)

Share this post


Link to post

Trace shows that there is a semicolon separating the "expression" and the "numdecimalplaces" parts of the expression. It should be a comma: ","

 

If you want to trim off the last 4 characters of the input string then you may want to use the Left function instead, something like this:

 

Left("$RV[calling_number]", Len("$RV[calling_number]")-4)

 

or if the length of number is always 9 then you can use:

 

Left("$RV[calling_number]", 5)

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
×