counter issue with select?


#1

hi
I have 30 objects named WF1_P1 thru 30. I need to select 1 thru 15.

this colde is correct right?

for($x=1;$x<15;$x++){
select (“WF1_P” + $x);
}

becuase it only selects number 15 and nothing before it?


#2

you are replacing you selection each time

it needs to be select -add instead of select


#3

thanks harm, yeah worked that one out finally


#4

Hi,

you can also store the thingies in an array… and then selecting the array… :wink:


proc selectDaWTFthingie()
{
	   string $daArray[];
	   for($x=1;$x<15;$x++)
	   {
		   $daArray[$x] = ("WF1_P" + $x);
	   }
	   select -r $daArray;
}
selectDaWTFthingie;

regards

Strarup


#5

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.