cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2670
Views
6
Helpful
3
Replies

CCX Editor - How to combine 2 String Variables

Luis Sanchez
Level 1
Level 1

[string] Variable1 = "/*"

[string] Variable2 = "4340"

I would like to combine these 2 Variables and set it to a 3rd Variable using the Set Step. So the final outcome would look like the following...

[string] Variable3 = "/*4340"

Here is what I have which is not working.

Set Variable3 = Variable1 + Variable2

3 Replies 3

Gergely Szabo
VIP Alumni
VIP Alumni

Hmm. I don't see the reason why but I at this moment I cannot test it myself.

Try Variable3 = Variable1.concat(Variable2)

Or, use this code block for Variable3:

{

StringBuilder buffer = new StringBuilder(50);

buffer.append(Variable1);

buffer.append(Variable2);

return buffer.toString();

}

HTH.

G.

Tanner Ezell
Level 4
Level 4

I've seen this come up a few times with various versions of the platiform. In most cases something like:

Set Variable 3 = Variable1 + "" + Variable2

Should fix it. If that doesn't work and you have premium license you can use the concat method.

Tanner

Tanner Ezell www.ctilogic.com

Luis Sanchez
Level 1
Level 1

Sorry guys. I actually had it correct. This is how I verified it.

Open CCX Editor without loading a script.  Then, in the Debug menu choose Reactive Script. Choose your Script for the Script Name and then choose a timeout value. (I choose 15secs)

Dial the number that triggers the script. Click on Debug and Insert a Breakpoint before the End Step. Now click on Debug and start Debugging. Once the script hits the Breakpoint, click on the Debug menu again and choose Evaluate. You can now select your Variable and evaluate its value.

I noticed that I was using a  /  (forward slash)  instead of a \  (back slash) as the escape character. I was combining my two variables but using the wrong slash.  Oops.  Thanks for the help though.  I now see there are more than one way to accomplish this.