Hi John,<div><br></div><div>Don't have the details in front of me but have a look at TField.OnGetText event.</div><div><br></div><div>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.</div>
<div><br></div><div>Hope this helps,</div><div><br></div><div>Colin<br><br><div class="gmail_quote">On 1 June 2011 21:59, John Bird <span dir="ltr"><<a href="mailto:johnkbird@paradise.net.nz">johnkbird@paradise.net.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I have a related question - I have been wondering how to display data in a<br>
dataset that is not either simple integer, string or date-time.<br>
<br>
Examples are:<br>
<br>
dates stored as an 8 digit integer (YYYYMMDD) (want to display as<br>
dd-mmm-yyyy and I already have the code to format it how I want)<br>
<br>
IRD numbers - 9 digits displayed as XXX-XXX-XXX<br>
<br>
Bank accounts integers displayed as XX-XXXX-XXXXXXX-XX<br>
<br>
Credit card numbers displayed as XXXX-XXXX-XXXX-XXXX<br>
<br>
in each case stored as integers, but how could I intercept the display on<br>
displaying the data and after entry to reformat them like this?<br>
What do others do?<br>
<br>
For displaying I am hoping the answer is not just to store them as strings,<br>
as I still have the issue of how I validate entry.<br>
<font color="#888888"><br>
John<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br>
</div></div></blockquote></div><br></div>