FieldDecimals

<< Click to Display Table of Contents >>

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

FieldDecimals

Declaration

function FieldDecimals( sFieldName: String ): Word;

Description

Extracts the number of decimals defined for a numeric field.

Parameters

sFieldName: The name of the field.

Return Value

The number of decimals defined for the named field. Only meaningful if the field in question is numeric - otherwise zero.

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, FieldName, FieldNum, FieldOffset, FieldType, FieldWidth