cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
660
Views
27
Helpful
7
Replies

Using variables to compare

diegorgarces
Level 1
Level 1

Hi all,

In need compare called number with a variable. For example, variable is: "extension". If "extension" is "3234" go to label "numbers begin with 32", but if "extension" is "3520" go to label "numbers begin with 35". I know what can i do to identiefied called number and make go to.

I need to know how compare the called number with a range extension.

What can i do?

2 Accepted Solutions

Accepted Solutions

William Bell
VIP Alumni
VIP Alumni

Could you please identify the product and version that you are trying to use to accomplish this task?

IF UCCX, then you could use the expression builder and something like this:

Set myextension="32567"  /*insert and use your existing process to collect these digits

Set myrange = {myextension.substr(0,2)}

Switch (Str myrange)

...etc...

Check this link for more info on the string functions available to you via the expression builder:

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html

And here for syntax requirements of the .substr() method:

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#substring%28int,%20int%29

HTH.

Regards,
Bill

Please remember to rate helpful posts.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

View solution in original post

Yes, you will need both the myextension and myrange variables declared as type String.  I also double checked the syntax on my CRS editor.  Looks like the expression builder is looking for .substring as the method as opposed to .substr.  My apologies for the confusion.  Also, the curly braces aren't necessary.  I was trying to show that you would use the expression builder.

Anyway, take a look at this screen shot:

This can be applied without catching a syntax error and should work for you.  Try it out and let us know.

HTH.


Regards,
Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

View solution in original post

7 Replies 7

htluo
Level 9
Level 9

It sounds like you're asking for a programming technique.  It depends on what programming language you're using.

For example, in Visual Basic, you may use Left(strVar, 2) or strVar.Substring(0, 2) to extract the first two digits.

Michael

http://htluo.blogspot.com

William Bell
VIP Alumni
VIP Alumni

Could you please identify the product and version that you are trying to use to accomplish this task?

IF UCCX, then you could use the expression builder and something like this:

Set myextension="32567"  /*insert and use your existing process to collect these digits

Set myrange = {myextension.substr(0,2)}

Switch (Str myrange)

...etc...

Check this link for more info on the string functions available to you via the expression builder:

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html

And here for syntax requirements of the .substr() method:

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#substring%28int,%20int%29

HTH.

Regards,
Bill

Please remember to rate helpful posts.

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

Hi all.

I´m working with Uccx 7.0

I try to identified around 400 extensions. Let me try with William´s recomendation.

William: it´s posible follow your recomendation using editor script to uccx 7?

When you use the "set" step for variable myrange you can use the expression builder to add the string manipulation.

Regards,

Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify

In expression builder i´m using

Set myrange = {myextension.substr(0,2)}, but i have an error.

Unable to parse expression; undefinied method: substr for class:java.lang.String (line:1, col:2)

myrange variable could be type: String?

Yes, you will need both the myextension and myrange variables declared as type String.  I also double checked the syntax on my CRS editor.  Looks like the expression builder is looking for .substring as the method as opposed to .substr.  My apologies for the confusion.  Also, the curly braces aren't necessary.  I was trying to show that you would use the expression builder.

Anyway, take a look at this screen shot:

This can be applied without catching a syntax error and should work for you.  Try it out and let us know.

HTH.


Regards,
Bill

HTH -Bill (b) http://ucguerrilla.com (t) @ucguerrilla

Please remember to rate helpful responses and identify


Mr William: Thank you. The Script It´s working !!!!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: