S
Simon
I'm trying to find some nice, concise code that asks the user for their
name and then stores it. I'd like it to behave as follows:
1. The user can type in up to 12 letters or numbers
2. Once 12 letters or numbers have been entered onto the screen,
nothing is displayed if they press further keys
3. If there are 12 letters on the screen and they user has made a
mistake then they can delete letters using backspace
4. The code only saves the user's name once enter is pressed (ie check
for '\n')
Theoretically this should be very easy but I've been having an
incredible amount of difficulty with it. I'm sure that it's been done
thousands of times before but I can't find any examples. Can anyone
help?
Thanks in advance
Simon
name and then stores it. I'd like it to behave as follows:
1. The user can type in up to 12 letters or numbers
2. Once 12 letters or numbers have been entered onto the screen,
nothing is displayed if they press further keys
3. If there are 12 letters on the screen and they user has made a
mistake then they can delete letters using backspace
4. The code only saves the user's name once enter is pressed (ie check
for '\n')
Theoretically this should be very easy but I've been having an
incredible amount of difficulty with it. I'm sure that it's been done
thousands of times before but I can't find any examples. Can anyone
help?
Thanks in advance
Simon