Board index » delphi » Field Size?

Field Size?

I wrote a simple utility for exporting field data from a table, however, I
would like to add the basic choices of Variable & Fixed width fields.

How do I write the fields out in Fixed width. TField has a Size property,
but is is always Zero (0) for types other than Strings.

Shane Holmes
Sh...@Holmes.net

 

Re:Field Size?


Quote
On Tue, 1 Feb 2000 14:09:40 -0800, "Shane Holmes" <sh...@holmes.net> wrote:
>I wrote a simple utility for exporting field data from a table, however, I
>would like to add the basic choices of Variable & Fixed width fields.

>How do I write the fields out in Fixed width. TField has a Size property,
>but is is always Zero (0) for types other than Strings.

Use the BDE API function DbiGetFieldDescs. This function fills a FLDDesc
descriptor structure (record in Pascal vernacular) with details about a
field's definition. In this structure, the iUnits1 field holds the
precision (size for non-numeric field types) and iUnits2 holds the scale
(for numeric fields only).

See the BDE API online help file, BDE32.HLP, for more information. This
file is installed in the main BDE directory. The topic for the
DbiGetFieldDescs has a Delphi source example showing how to traverse each
field definition for a table and retrieve field properties for each.

==========================================================================
Steve Koterski                  "Computers are useless. They can only give
Technical Publications          you answers."
Borland                                       -- Pablo Picasso (1881-1973)
http://www.borland.com/techpubs/delphi

Other Threads