An article in the first issue of Blaise magazine for Pascal got me
thinking about many of my utility functions that I commonly use in almost
every program I write, and so I thought I'd ask about one of them to get
your opinions on a particular set I use to validate the input fields for
programs of all types.
When ever a user has to input data of any kind, the first thing I do
is check to make sure that a value has actually been entered. Next if
necessary, I'll check to insure it is of the correct type and/or range, that
if filenames or directories they meet naming standards and actually exist,
that their extensions, if any, are correct, and quite often I also need to
validate case depending on the situation. But I had never bothered to check
for blank spaces before and after a string value as this article was about!
I know that especially when entering into dB fields such spaces can
really screw things up, so I'm going to incorporate such a check in my own
set of utility functions before going on with my current project, as it
involves quite a lot of string dB fields.
Anyway, I was wondering how others do all the many checks and
validations for entry that are either needed or just possible. Do you run
them all as a standard method? Have you incorporated multiple checks or
validations into one function or do you call those needed one by one? Do
you classify them by type or control?
You never see this kind of code in most examples found in books or
online, but I would imagine these considerations would be taken up early in
any traditional programming education...none of which I've had!
from Robert Meek dba "Tangentals Design"
e-mail: [EMAIL PROTECTED]
Freelance Windows Programming for XP and Vista
Also proud to be a Moderator of the "Delphi-List" at elists.org
"Reality cannot be explained...only enjoyed or endured as your current
perspective allows!"
_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi