Technique to have text display a variable value

Discuss Lemur and share techniques.
Post Reply
midimockup
Newbie
Posts: 41
Joined: 08 Nov 2012 15:55

Technique to have text display a variable value

Post by midimockup »

Hey all!

I just wanted to share a simple technique that will allow your text objects to display variable values in Lemur 5. All you have to do is join two strings, the first of which you leave blank.

Code: Select all

decl string1='';
decl string2=variablevalue;
decl word=string1+string2;
setattribute(Text,'content',word);
Hope that helps someone out there! Text objects have an advantage over monitors because they use up less FPS.
Best
MOH
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Technique to have text display a variable value

Post by Softcore »

Yup, nice trick.

Essentially the trick is that any variable can be converted into a string if you just "add" an empty string value before it.

So for example:

Code: Select all

decl val ='' + variablevalue;
Will take any variable (integer or float) and convert it into a string which can then be displayed as text.

;)
midimockup
Newbie
Posts: 41
Joined: 08 Nov 2012 15:55

Re: Technique to have text display a variable value

Post by midimockup »

Ah that's even more elegant! Thanks Softcore!
Post Reply