Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

0-9 keys to populate a text object.

Mark Nizer/Neisser Sep 15, 2018 09:46AM CEST

My need is simple. I just want to have 10 buttons with 0 thru 9 as their value.

When you push them they fill in a text object.

So If I pushed button 1, then 2 then 3, the Text Object would show 123.

I love lemur.

Up 0 rated Down
MiluX Oct 08, 2018 08:02PM CEST
Hey Mark!
This would be easy to do with Lemur, but we would need more info.
Are the buttons "pads" (momentary) or "switches" (toggle) ?
If the text shows 123 and one presses 1 again, should it then only show 23 ?

Cheers,

MiluX
Up 0 rated Down
MiluX Oct 08, 2018 08:33PM CEST
Let's try if this fits your needs :

- Create a Switches object. Set it to 10 columns (and 1 row). You can tick "Numbers" to show the numbers 0 to 9.

- Create a Text Object.

- In this text Object create a script, that you execute On Expression "Switches.x"

- In the script text, type:
decl buttons_array;
decl i;
decl text;

buttons_array[0] = Switches.x[0] ? '0' : '';
buttons_array[1] = Switches.x[1] ? '1' : '';
buttons_array[2] = Switches.x[2] ? '2' : '';
buttons_array[3] = Switches.x[3] ? '3' : '';
buttons_array[4] = Switches.x[4] ? '4' : '';
buttons_array[5] = Switches.x[5] ? '5' : '';
buttons_array[6] = Switches.x[6] ? '6' : '';
buttons_array[7] = Switches.x[7] ? '7' : '';
buttons_array[8] = Switches.x[8] ? '8' : '';
buttons_array[9] = Switches.x[9] ? '9' : '';

text = buttons_array[0] + buttons_array[1] + buttons_array[2] + buttons_array[3] + buttons_array[4] + buttons_array[5] + buttons_array[6] + buttons_array[7] + buttons_array[8] + buttons_array[9];

setattribute(Text,'content',text);


Hope this helps!

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
support@liine.net
http://assets3.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete