Page 1 of 1

Technique to have text display a variable value

Posted: 03 Jan 2015 02:53
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

Re: Technique to have text display a variable value

Posted: 03 Jan 2015 11:45
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.

;)

Re: Technique to have text display a variable value

Posted: 03 Jan 2015 15:04
by midimockup
Ah that's even more elegant! Thanks Softcore!