How do I compare the length of a variable

Get help using Construct 2

Post » Sat Jan 14, 2017 6:58 pm

I want the user to enter a string using a textbox. It will be stored as a global variable.
However, I want to ensure that they can only enter a max of 8 characters in the text box.
How would I go about doing this?

Any help would be appreciated : P
B
6
Posts: 2
Reputation: 256

Post » Sat Jan 14, 2017 7:13 pm

Here's one way to do it
http://headbangames.com/textbox.capx
Image
B
80
S
30
G
12
Posts: 517
Reputation: 12,713

Post » Sat Jan 14, 2017 7:38 pm

Thanks
B
6
Posts: 2
Reputation: 256

Post » Sat Jan 14, 2017 8:07 pm

NP, you can always use len() to get the length of the string, but seems unnecessary in your case.
Image
B
80
S
30
G
12
Posts: 517
Reputation: 12,713


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests