Re: Text widget error checking [message #44962] |
Thu, 28 July 2005 13:08 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Brad Wallet writes:
> Can anyone give me some tips/pointers on how to best do error checking
> in a text widget? I have a text field, and I want to make sure that it
> remains a value that can be converted into an integer using reads. Any
> suggestions?
I use FSC_FIELD when I want to restrict a text field to
a particular kind of value. Set the value of the widget
and whatever type the value is, that is what you can put
into the field. You can also restrict the number of digits
or decimal places you want, etc.
http://www.dfanning.com/programs/fsc_field.pro
Call it "up front" checking, rather than "after the fact"
checking. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|