Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

applying labels from a vector using arraytostring()

lysdexic Jul 12, 2018 11:53AM CEST


Loving scripting in Lemur!

I'm having trouble with applying labels from a function that generates a vector.

I'm using this script to get the rows and columns from a Switches object.

myRows = getattribute(getobject(), 'row');
myCols = getattribute(getobject(), 'column');

myLabels = ceil(stretch({2,myRows*myCols},myRows*myCols));

Which generates a vector of integers, one for each Switch (intentionally indexing from 2).

But when I try to setattribute(getobject(),'labels', myLabels); they don't apply. I've tried permutations of that line with square and curly braces and no joy.

I'm guessing that this is because they're integers (or floats with no precision) not strings.

I've tried using arraytostring() with a for loop to iterate through the vector and i get junk.

decl i, size=sizeof(myLabels);

myLabels[i] = arraytostring(myLabels[i]);

Yeilds: a bunch of multicoloured commas, #, $, !

Can someone show me what I'm doing incorrectly?

Cheers! Loving the software!!


Up 0 rated Down
MiluX Oct 12, 2018 09:07AM CEST
Hey Lys,
I tried to write an integer to string conversion function. Maybe it would also work for you?

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found