FieldWidth

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods >

FieldWidth

Declaration

function FieldWidth( sFieldName: String ) Word;

Description

Extracts the width of the named field.

Parameters

sFieldName: The name of the field.

Return Value

The size in bytes of the named field.

Delphi Example

// Fills a list box with field information 

procedure Form1.Button1Click(Sender: TObject);

var

 iFldCount, i: Integer; 

 sInfo, sName: String; 

begin

 ApTbl.Open; 

 iFldCount := ApTbl.ApolloFieldCount; 

 for i := 1 to iFldCount do  

 begin  

         sName := ApTbl.FieldName( i ); 

         sInfo := sName + ', ' + ApTbl.FieldType( sName ); 

         sInfo := sInfo + ', ' + IntToStr( ApTbl.FieldWidth( sName ));

         sInfo := sInfo + ', ' + IntToStr( ApTbl.FieldDecimals( sName )); 

         ListBox1.Items.Add( sInfo );  

 end; 

end;

See Also

ApolloFieldCount, FieldDecimals, FieldName, FieldNum, FieldOffset, FieldType