Hello,
i have an array Oneto16={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
and i want to use it to set the labels of a padobject (the array changes dynamically).
But setattribute(padobject,'labels',Oneto16} doesnt work. Probably because the elements aren't strings.
How should a go about this to make it work?
array of numbers as labels
Re: array of numbers as labels
{'1','2',.......'16'}
-
- Regular
- Posts: 294
- Joined: 24 Jan 2012 18:22
Re: array of numbers as labels
yeah, but the values in the array change and so should the labels- that is the problem. If make the array strings from the start i lose the possibilty to change the numbers by adding/multiplying the values.
I think ineed some sort of conversion to strings but with array to string i didnt get far.
I think ineed some sort of conversion to strings but with array to string i didnt get far.
Re: array of numbers as labels
Ohhh I get it now....then use
decl i,k
for (i=0;i<sizeof(Oneto16);i++){
k=''+Oneto16;
}
and then use k instead of Oneto16
decl i,k
for (i=0;i<sizeof(Oneto16);i++){
k=''+Oneto16;
}
and then use k instead of Oneto16
-
- Regular
- Posts: 294
- Joined: 24 Jan 2012 18:22
Re: array of numbers as labels
Ahhh nice, this works. Thx.
Re: array of numbers as labels
As of Lemur 5 with string concatenation (or what was that called lol) you can make any number-array into a string by simply adding an empty string value before it....
so for example if
k=1;
''+k = '1'
so for example if
k=1;
''+k = '1'