[DUG] Validate data entry

Colin Johnsun colin.adug at gmail.com
Thu Jun 2 00:18:49 NZST 2011


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 <johnkbird at 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 at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20110601/a1f3821b/attachment.html 


More information about the Delphi mailing list