Hi John,

Don't have the details in front of me but have a look at TField.OnGetText
event.

Wherever the field gets displayed it will call on its OnGetText event if it
has been defined. In that event you can reformat you field into what ever
string format you like.

Hope this helps,

Colin

On 1 June 2011 21:59, John Bird <johnkb...@paradise.net.nz> wrote:

> I have a related question - I have been wondering how to display data in a
> dataset that is not either simple integer, string or date-time.
>
> Examples are:
>
> dates stored as an 8 digit integer (YYYYMMDD) (want to display as
> dd-mmm-yyyy and I already have the code to format it how I want)
>
> IRD numbers - 9 digits displayed as XXX-XXX-XXX
>
> Bank accounts  integers displayed as XX-XXXX-XXXXXXX-XX
>
> Credit card numbers displayed as XXXX-XXXX-XXXX-XXXX
>
> in each case stored as integers, but how could I intercept the display on
> displaying the data and after entry to reformat them like this?
> What do others do?
>
> For displaying I am hoping the answer is not just to store them as strings,
> as I still have the issue of how I validate entry.
>
> John
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi@delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
> unsubscribe
>
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Reply via email to