Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoiding duplicates

Status
Not open for further replies.

rreddy01

Programmer
Apr 18, 2012
15
US
i am trying to get all the codevalues separated by commas in a variable x but while doing this getting some duplicates or some values are missing.

WhilePrintingRecords;
stringVar x;

if length(x) = 0 then
x := x + {CODEVALUE.DESCR}
// else
// x := x + ", " +{CODEVALUE.DESCR};

else if
(
stringvar array Rev_Array := x;
stringvar array Rev_Array_Final;
stringvar Rev_Codes;
numbervar Counter;
numbervar i;

for counter := 1 to ubound(Rev_Array) Do (
if NOT (Rev_Array[counter] in Rev_Array_Final) then (
redim preserve Rev_Array_Final [ubound(Rev_Array_Final)+1];
i := i + 1;
Rev_Array_Final := Rev_Array[counter];
Rev_Codes:=JOIN(Rev_Array_Final,",");
))) then
Rev_Codes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top