cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
143
Views
10
Helpful
3
Replies
Highlighted
Beginner

UCCX - Variable already defined error

Hello, (

I have this code in a Do step and it's giving the error,  "Unable to parse the expression; b is already defined (line:3 , col:5). I do not even have a variable named 'b' defined in the script. I am confused about this error. Can someone please help me?

{
int a =0;
for(int b=0; b<sStringOfTypeArray.length; b++){
boolean isdistinct = true;
for(int j=0; j<b; j++){
if(sStringOfTypeArray[b] == sStringOfTypeArray[j]){
isdistinct =false;
break;
}
}
if(isdistinct){
System.out.print(sStringOfTypeArray[b]+" ");
ArrNewMfrList[a]=sStringOfTypeArray[b];
a++;
}
}
}

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
VIP Advisor

Re: UCCX - Variable already defined error

Yeah, it's a quirk with the expression language (based on Java, but not 100% Java).

 

Instead of this:

for (int i = 0; i < 10; i++) {
  /* do something */
}

Do this:

int i;
for (i = 0; i < 10; i++) {
  /* do something */
}

Anthony Holloway

View solution in original post

3 REPLIES 3
Highlighted
VIP Advisor

Re: UCCX - Variable already defined error

Yeah, it's a quirk with the expression language (based on Java, but not 100% Java).

 

Instead of this:

for (int i = 0; i < 10; i++) {
  /* do something */
}

Do this:

int i;
for (i = 0; i < 10; i++) {
  /* do something */
}

Anthony Holloway

View solution in original post

Highlighted
Beginner

Re: UCCX - Variable already defined error

It worked! Thank you!!
VIP Advisor

Re: UCCX - Variable already defined error

Does System.out.print do anything in UCCX? I've never tried that.

 

EDIT: Looks like it breaks your script.  ;)

https://community.cisco.com/t5/contact-center/reactive-debug-error/m-p/4048386/highlight/true#M115561


Anthony Holloway
CreatePlease to create content