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!!!????
Labeling (String Concat) Arrays - SOLVED!!!
Labeling (String Concat) Arrays - SOLVED!!!
Last edited by Joe Soap on 07 Aug 2014 20:42, edited 1 time in total.
Re: Labeling Arrays (String Concat)
Can you post an example of your code as it is?
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?
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?
Re: Labeling Arrays (String Concat)
Is the "multilabel" attribute enabled?
Works here!
Works here!
- Attachments
-
- Works_here.jzml
- (12.61 KiB) Downloaded 57 times
Re: Labeling Arrays (String Concat)
Also......
- Attachments
-
- Works_here-no_i_needed.jzml
- (12.59 KiB) Downloaded 61 times
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.
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.
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.
Solution courtesy of Antonio Blanca.
- Attachments
-
- Individual Pads labels Concat_small.jzlib
- (36.28 KiB) Downloaded 80 times
Re: Labeling (String Concat) Arrays - SOLVED!!!
I somehow missed the "single pads" detail lol. Sorry for that!
Re: Labeling (String Concat) Arrays - SOLVED!!!
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 .