View Full Version : counter issue with select?


jenny077
09 September 2007, 02:50 PM
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?

harmless
09 September 2007, 03:04 PM
you are replacing you selection each time

it needs to be select -add instead of select

jenny077
10 October 2007, 01:08 AM
thanks harm, yeah worked that one out finally

strarup
10 October 2007, 10:53 AM
Hi,

you can also store the thingies in an array... and then selecting the array... ;)


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

regards

Strarup

CGTalk Moderation
10 October 2007, 10:53 AM
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.


1