Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Populate an array with only unique values Post Reply Post New Topic
Author Message
pbengtss
Newbie
Newbie
Avatar

Joined: 18 May 2016
Online Status: Offline
Posts: 22
Quote pbengtss Replybullet Topic: Populate an array with only unique values
    Posted: 22 May 2016 at 10:49pm
Is there an easy way to populate an array variable with only unique values from a field? No specific order is necessary.
IP IP Logged
pbengtss
Newbie
Newbie
Avatar

Joined: 18 May 2016
Online Status: Offline
Posts: 22
Quote pbengtss Replybullet Posted: 23 May 2016 at 2:17am
I found a way:

WhileReadingRecords;
StringVar Array ArticlesVar;
NumberVar i;

IF NOT ({db.ArtNr} IN ArticlesVar) THEN
(
    i:=i+1;
    ReDim Preserve ArticlesVar [i];
    ArticlesVar[i]:={db.ArtNr};
);
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.