Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to limit the number of lines in a memo ?
Message
De
21/12/1999 16:59:18
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00306732
Message ID:
00306982
Vues:
42
>Ed,
>
>>>ekp is just a variable to check the number of keystrokes. When it reaches 5 an enter key is automaticaly pressed and the variable ekp is set back to 0.
>>
>>Do backspaces count as keystrokes?
>
>Yes, they count and they should not. They should also be only digits, not characters. I think, it's necessary additional check here. And I also don't like an idea of public variables. I'd better make this variable to be a class property.

I don't think you understood the question - it's not an issue of whether the KeyPress event should respond to a backspace (it should IMO), it's a flaw in the methodology to maintain the data in the control.

You're trying to do this in the most difficult way I can imagine to approach the problem of fitting the input to the class interface. You have a UI requirement that states that if a value exists, it must consist of 5 valid characters that can be validated against a master list of zip codes (there's no pure numerical method to filter out legally constructed but unassigned zip codes AFAIK) in the case of a US Postal code, a 5 character string consisting only of the digits 0-9 (you're going to really, really dislike Canadian Postal codes, which are 6 characters in length, and alternating character positions are all digits or all uppercase letters. And then we get into the Zip+4 system that's been in play now for several years...)

I'd do what I could to create a control that only allowed one item at a time to be edited with fixed formatting and verification, and then convert the input to the format needed by the btcc class. Without having seen the semi-mystical btcc class, I'd guess it would be easier to collect the data and ease the data entry task, and then convert it to the format the btcc class required. The btcc class shouldn't give a damn what type of control was used to input the data (or even that it came from a control and not some other data source) as long as the value passed in to it was in the expected form.

At some point, it'll be easier for you to abstract the interface between the editbox and the btcc class than to try to make the wrong control act the way you'd like it to behave.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform