String concatenation working with setexpression?

Discuss problems and solutions.
Post Reply
electrofux
Regular
Posts: 294
Joined: 24 Jan 2012 18:22

String concatenation working with setexpression?

Post by electrofux »

Why is the following code not working:

On x:
decl patnum ='Pattern'+PatternNumber;
setexpression(patnum,'Direction',firstof(x));
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: String concatenation working with setexpression?

Post 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
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: String concatenation working with setexpression?

Post 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')
electrofux
Regular
Posts: 294
Joined: 24 Jan 2012 18:22

Re: String concatenation working with setexpression?

Post 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
electrofux
Regular
Posts: 294
Joined: 24 Jan 2012 18:22

Re: String concatenation working with setexpression?

Post by electrofux »

works like a charm. Thx :-)
Post Reply