Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Determine # of characters input in a field
Message
From
28/02/2003 08:30:13
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00759242
Message ID:
00759336
Views:
17
Aha! Sergey,

Got you on this one. I didn't forget about it. To have forgotten it, I'd have had to have thought about it in the first place. ;)

That'll teach me to shoot my fingers off before really thinking about it.

Mea Culpa

Alan

>Alan,
>
>You forgot about backspace key. Also, what would you do if after entering a few spaces user preses LeftArrow. Would you treat it as backspace key? It became even more complicated if user desides to edit what he/she entered. Using editbox instead of textbox maybe an alternative.
>
>>I doubt there is a way to do it without somehow using the keypress event to capture individual keystrokes. It doesn't need to be very complicated though. You only really need to worry about the keypress of the spacebar. If you just count the space keys, then you can add them to the normal "Len(AllTrim(text1.text))"
>>
>>Alan
>>
>>>Is it possible (without using keypress) to determine the # of characters (including trailing blanks) in a field?
>>>For example, I have a field in an form (no control source) that has an input mask of =replicate('X',30). If 'abc' or 'abc ' is input, the length of this.value is 30. If I check the length of the alltrim, it is 3, of course.
>>>Or to present the question another way ... How would I determine * exactly * what the user entered?
>>>TIA.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform