TextBox

Get help using Construct 2

Post » Tue Mar 27, 2012 3:56 pm

Hello,

I wanted to ask a question about the textbox:

I enter a textbox solamante numbers, it was with the property Type: Number and gives me problems, it is the entry of numbers and letters, as I can make one income numbers.

other questions as I can restricting in the length of words within a textbox

Thanks
B
4
Posts: 11
Reputation: 472

Post » Wed Mar 28, 2012 1:19 pm

A textbox gives you Text when you read it's output. If you want to get a number written in the textbox you have to 'change' the type of the value. If you want integers then it's possible with the expression: int(nameOfTheTextbox.Text) --> you get the integer, float works similar for decimalnumbers..
the opposite: if you want to write a number in the textbox you can do this with set Text and the expression: str(4) or with 4&"" --> both make numers to text/stringsJoe72012-03-28 13:24:52
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Wed Mar 28, 2012 1:44 pm

And for the other question : This simple commented capx.

Be sure to check the system expressions if you wonder what len() and mid() are.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,805


Return to How do I....?

Who is online

Users browsing this forum: getplay and 27 guests