Art,
Quote
Art Begun wrote in message <7mb2sd$p2...@forums.borland.com>...
>I haven't used anything but Paradox files
>so I may be way off base here, but have you
>tried setting the DisplayFormat of the Tfield.
>The Tfields show up when you double click on the
>Table component and right click on the list and choose
>add fields.
Thanks for your suggestion. However, in my original post, I specified that I
needed to set thngs like displayformat at runtime, not design time by the
method you suggested. This would work for persistent fields, as opposed to
dynamic fields. In my application, I can not set all the fields persistent
because I don't know what they might be (and you can't mix persistent and
dynamic fields). However, working from your suggestion I was able (after
nearly TWO hours with the online docs and trial and error) to figure out how
to set the displayformat property at runtime for dynamic field components.
Apparently, the DisplayFormat property isn't "published" at runtime and is
only intended to be used from FieldComponent editor at designtime. Therefore
the following causes a compile-time error of 'Undeclared identifier :
displayformat' :
table1.FieldByName('Field1').displayformat := '0.##';
But, using a trick that someone more experienced than I showed me, I tried
putting the following in the beginning of the Type section:
tTableCracker = Class(TTable);
and then the following works:
tTableCracker(table1.FieldByName('Field1')).displayformat := '0.##';
Regards,
Bill
myname := 'bill_richards';
myISP := 'nic.edu';
myemail := myname + '@' + myISP;