I have a string that looks like this:
255,255,124,532,322,322,322,664,342
I need it to look like this (No Duplicates)
255,124,532,322,664,342
I wrote this code, but it just returns a bunch of ",,,,,,,,,,,". The max amount of elements is 30 in the original string, but I'm not sure if I am using redim properly. I'm also not sure why the Rev_Array_Final is just filled with comma's and not the values. Any tips?
255,255,124,532,322,322,322,664,342
I need it to look like this (No Duplicates)
255,124,532,322,664,342
I wrote this code, but it just returns a bunch of ",,,,,,,,,,,". The max amount of elements is 30 in the original string, but I'm not sure if I am using redim properly. I'm also not sure why the Rev_Array_Final is just filled with comma's and not the values. Any tips?
Code:
whilereadingrecords;
stringvar array Rev_Array := split({UWVW_BKB437_REV_CD_COV.REV_CD_ALL}, ",");
stringvar array Rev_Array_Final; //Scrubbed of Dups!
stringvar Rev_Codes;
numbervar Counter;
numbervar i:=1;
redim Rev_Array_Final [30];
for counter := 1 to ubound(Rev_Array) Do
(
(
if NOT (Rev_Array[counter] in Rev_Array_Final) then Rev_Array_Final[i]:=Rev_Codes[counter];
i:=i+1;
)
);
Rev_Codes:=JOIN(Rev_Array_Final,",");
Rev_Codes