Labeling (String Concat) Arrays - SOLVED!!!

Discuss Lemur and share techniques.
Post Reply
Joe Soap
Regular
Posts:475
Joined:07 Jul 2012 15:04
Labeling (String Concat) Arrays - SOLVED!!!

Post by Joe Soap » 28 Jul 2014 12:44

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!!!????
Last edited by Joe Soap on 07 Aug 2014 20:42, edited 1 time in total.

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Labeling Arrays (String Concat)

Post by Softcore » 28 Jul 2014 14:09

Can you post an example of your code as it is?

Joe Soap
Regular
Posts:475
Joined:07 Jul 2012 15:04

Re: Labeling Arrays (String Concat)

Post by Joe Soap » 28 Jul 2014 14:27

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?

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Labeling Arrays (String Concat)

Post by Softcore » 07 Aug 2014 09:56

Is the "multilabel" attribute enabled?

Works here!
Attachments
Works_here.jzml
(12.61KiB)Downloaded 61 times

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Labeling Arrays (String Concat)

Post by Softcore » 07 Aug 2014 09:58

Also......
Attachments
Works_here-no_i_needed.jzml
(12.59KiB)Downloaded 64 times

Joe Soap
Regular
Posts:475
Joined:07 Jul 2012 15:04

Re: Labeling Arrays (String Concat)

Post by Joe Soap » 07 Aug 2014 10:34

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! :D

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.

Joe Soap
Regular
Posts:475
Joined:07 Jul 2012 15:04

Re: Labeling Arrays (String Concat)

Post by Joe Soap » 07 Aug 2014 20:27

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.
Attachments
Individual Pads labels Concat_small.jzlib
(36.28KiB)Downloaded 86 times

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Labeling (String Concat) Arrays - SOLVED!!!

Post by Softcore » 08 Aug 2014 15:04

I somehow missed the "single pads" detail lol. Sorry for that!

Joe Soap
Regular
Posts:475
Joined:07 Jul 2012 15:04

Re: Labeling (String Concat) Arrays - SOLVED!!!

Post by Joe Soap » 08 Aug 2014 21:28

No worries dude - it's my English I'm sure! ;)

Cheers for taking the time to help innit :).

Post Reply