General
Labeling (String Concat) Arrays - SOLVED!!!
Started by Joe Soap on .
Sign in or create an account to join the conversation.
Hey guys - little problem that's driving me nuts.
Constructing an object with a while loop, and having problems figuring out the correct syntax to iterate setting the labels against the array.
I know / remember someone posted this a while back but for the life of me I can't find it anywhere - nor can I seem to work it out from first principles . . . suspect my aching brain has been working on the thing too damn long to grok anything at all right now,
Some combination of a for loop within the while loop? I know it's that I'm not setting up an index . . . at least I think it is. Dammit.
[edit]
ie: I have an array of labels with 16 entries and I want to spray these across the 16 member-objects captured by the while loop - but all I'm getting is the first entry of the labels sprayed accross the entire object array. Using while loop so i can add to or subtract objects without crashing - portable y'see!
halp!!!????
Constructing an object with a while loop, and having problems figuring out the correct syntax to iterate setting the labels against the array.
I know / remember someone posted this a while back but for the life of me I can't find it anywhere - nor can I seem to work it out from first principles . . . suspect my aching brain has been working on the thing too damn long to grok anything at all right now,
Some combination of a for loop within the while loop? I know it's that I'm not setting up an index . . . at least I think it is. Dammit.
[edit]
ie: I have an array of labels with 16 entries and I want to spray these across the 16 member-objects captured by the while loop - but all I'm getting is the first entry of the labels sprayed accross the entire object array. Using while loop so i can add to or subtract objects without crashing - portable y'see!
halp!!!????
Subject: Re: Labeling Arrays (String Concat)
Can you post an example of your code as it is?Subject: Re: Labeling Arrays (String Concat)
Hey dude!Here's the relevant bit:
decl name = 'sel_1';
decl obj = findchild(presets2,name);
decl i;
while(obj)
{
setattribute(obj,'labels',{'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'});
obj = getnext(obj);
i++;
}
. . . broken just broken! How to assign and iterate the labels array to the object array?
Subject: Re: Labeling Arrays (String Concat)
Is the "multilabel" attribute enabled?Works here!
Works_here.jzml
Subject: Re: Labeling Arrays (String Concat)
Oh hey man, I got that resolved - then ran into other problems . . . tore hair out, lost sleep etc. Resolved those.You know how it goes!
And in the end? I'm probably gonna go a different way - but three weeks wrestling with an assortment of assignment order, loop structure and plain old just not understanding WTF I was looking at (fully, or at all in some cases) issues, time well spent.
Hopefully it sinks in.
Subject: Re: Labeling Arrays (String Concat)
Just looked at those out of curiosity - neither of the solutions provided actually address the problem as specified, which was to label 16 separate SINGLE pads objects as if they were one 16*1 (or 8*2 or 4*4) Pads object.Solution courtesy of Antonio Blanca.
Individual Pads labels Concat_small.jzlib
I somehow missed the "single pads" detail lol. Sorry for that!
No worries dude - it's my English I'm sure! 
Cheers for taking the time to help innit
.
Cheers for taking the time to help innit