cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
680
Views
10
Helpful
3
Replies

UCCX - Variable already defined error

Nliya53887
Level 1
Level 1

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

Anthony Holloway
Cisco Employee
Cisco Employee

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 */
}

View solution in original post

3 Replies 3

Anthony Holloway
Cisco Employee
Cisco Employee

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 */
}

It worked! Thank you!!

Anthony Holloway
Cisco Employee
Cisco Employee

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

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: