Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread BCD fields with default 0
Wed, Jun 30 2010 12:46 PMPermanent Link

Robert Kaplan

If I have a BCD field with a default of zero, should it allow changes to
null? ie if you are editing the field and press delete, it becomes null, not
zero.

Robert

Wed, Jun 30 2010 1:47 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Robert


Defaults only apply on insert/append not on edit. What happens on edit depends on three things, the engine, the component you're using to edit, and how you return the data to the field after edit.

On top of that there's the presentation level which generally can't present a null so chooses some other value (the worst is TDateTime - ie a float - which return zero which is sometime in 1899 I think).

To find out if a field is really null test with field.IsNull.

What I do is explicitly call .Clear for those fields I want to be null.

Roy Lambert [Team Elevate]
Thu, Jul 1 2010 5:35 AMPermanent Link

John Hay

> If I have a BCD field with a default of zero, should it allow changes to
> null? ie if you are editing the field and press delete, it becomes null,
not
> zero.

Yes it should.  If you want to prevent this then set Required to true for
the field.

John

Image