FieldType

<< Click to Display Table of Contents >>

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

FieldType

Declaration

function FieldType( sFieldName: String ): String;

Description

Reports the type of the named field.

Parameters

sFieldName: The name of the field.

Return Value

The field type is returned as a string.

 

Standard DBF types are C (character), I (Long Integer), N (numeric), M (memo), D (date), and L (logical). Extended Apollo types are P (Picture) and B (BLOB). The extended types P and B are variations of a memo field and are listed here for information purposes only. P and B types are NOT valid types for use by CreateField.

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

CreateField, ApolloFieldCount, FieldDecimals, FieldName, FieldOffset, FieldWidth