General
Technique to have text display a variable value
Started by midimockup on .
Sign in or create an account to join the conversation.
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.
Best
MOH
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.
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
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:

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:
decl val ='' + variablevalue;
Will take any variable (integer or float) and convert it into a string which can then be displayed as text.Ah that's even more elegant! Thanks Softcore!