Code to copy non Unique values from container to container:

Hi,
To copy non unique value from container to container we use the following code…..

static void ctcnonunique(Args _args)
{
container c = [1,2,1,3,4,3], c1;
int i, j, l, m, p;
;

c1 = connull();
for(i=1; i <= conlen(c); i++)
{
l = conpeek(c,i);
for(j = 1; j <= conlen(c); j++)
{
if(i != j || i == conlen(c))
{
if(i != j)
{
m = conpeek(c,j);
}
if(m == l)
{
if(!confind(c1,l))
{
p++;
c1 = conins(c1,p,l);
info(strfmt("At %1 Position Value is %2",confind(c1,l),conpeek(c1,p)));
break;
}
}
else
{
continue;
}
}
else
{
continue;
}
}
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s