Invalid numeric value in a TDBEdit 
Author Message
 Invalid numeric value in a TDBEdit

I am using delphi 2 with Paradox data tables.

With a TDBEdit component linked to a TFloatField, the component
very carefully prevents you from typing invalid characters, such
as letters.  It obviously has to let the user type a '.' in
order to have decimal numbers, but the problem occurs when the
user perhaps types multiple points, e.g. '...'  This causes an
exception as soon as the user tries to exit the DBEdit.

I want to trap the exception elsewhere, such as BeforePost, rather
than when exiting the edit box.  The only event I have found that
occurs before the exception is the OnSetText event of the TField.

Unfortunately this event overrides rather than supplements the
default handling.

Does anyone have any suggestions for trapping the error when I
want??

Paul Burrows



Sun, 04 Apr 1999 03:00:00 GMT  
 Invalid numeric value in a TDBEdit

Quote:

> I am using Delphi 2 with Paradox data tables.

> With a TDBEdit component linked to a TFloatField, the component
> very carefully prevents you from typing invalid characters, such
> as letters.  It obviously has to let the user type a '.' in
> order to have decimal numbers, but the problem occurs when the
> user perhaps types multiple points, e.g. '...'  This causes an
> exception as soon as the user tries to exit the DBEdit.

> I want to trap the exception elsewhere, such as BeforePost, rather
> than when exiting the edit box.  The only event I have found that
> occurs before the exception is the OnSetText event of the TField.

> Unfortunately this event overrides rather than supplements the
> default handling.

> Does anyone have any suggestions for trapping the error when I
> want??

> Paul Burrows


When I tried something similar, the only way i could handle the error was by setting up an error handler
for the Application object. On posterror and field Onexit did not work.


Wed, 07 Apr 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Fw: How to determine if a part of a string is a numeric value

2. Aggregate functions on dBase tables with NULL numeric values

3. Check for numeric values

4. cannot read numeric value from a table

5. Need help with type casting on numeric values from AVG aggregate functions

6. Coverting TDBEdit value to string !!!

7. (HOW?) Assigning value of TDBEdit to a TLabel

8. (HOW?) Assigning value of TDBEdit to a TLabel

9. ORA-1722 Invalid number when inserting a value

10. Invalid Value for Field "Date1"

11. Please a sample, how to test numeric input in TDBEdit.

12. changing values to "no value"

 

 
Powered by phpBB® Forum Software