Page 1 of 1

String concatenation working with setexpression?

Posted: 30 Mar 2014 21:48
by electrofux
Why is the following code not working:

On x:
decl patnum ='Pattern'+PatternNumber;
setexpression(patnum,'Direction',firstof(x));

Re: String concatenation working with setexpression?

Posted: 30 Mar 2014 21:53
by Softcore
What IS pattern? Is it an object? if so....

Code: Select all

decl patnum=findobject('Pattern'+PatternNumber);
setexpression(patnum,'Direction',firstof(x));
will work

Re: String concatenation working with setexpression?

Posted: 30 Mar 2014 21:56
by Softcore
Generally speaking, and I dont know why this took me so long to understand is the difference between

a referenced object, for example Switches and the string value 'Switches'

In the manual of Lemur whenever in the reference the word "object" is used...you need a real actual reference to the object - findobject(string-name-of-object) - in our example, Switches.
Whenever the word "name" is used, then you are looking for the string ('Switches')

Re: String concatenation working with setexpression?

Posted: 30 Mar 2014 23:22
by electrofux
Softcore wrote:What IS pattern? Is it an object? if so....

Code: Select all

decl patnum=findobject('Pattern'+PatternNumber);
setexpression(patnum,'Direction',firstof(x));
will work
The Object is Pattern1, Pattern2, Pattern3- all containers with variables like "Direction" in them. Thought i could directly reference them with the new feature.
But findobject is cool , should work. Thx again.

Cheers

Re: String concatenation working with setexpression?

Posted: 31 Mar 2014 17:57
by electrofux
works like a charm. Thx :-)