Re: validating user input [message #44604] |
Tue, 05 July 2005 03:50  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Soren wrote:
> Does someone know a smart way of validating nummerical input read
> from a text widget. I am thinking in terms of validating whether it is
> a number or not.
> Is the best thing just to catch the error if float(inputstring) fails?
It is sometimes easier to make sure the user can't type
anything BUT the kind of input you expect. See, for
example, FSC_FIELD:
http://www.dfanning.com/programs/fsc_field.pro
Cheers,
David
|
|
|
|