TableGetField
Previous  Top  Next

Prototype

StrFieldValue:=TableGetField(intTableHandle, intFieldNumber)

Description

It restores the field value by using a progressive field number as indicator.

Parameters

IntTableHandle
: integer value corresponding to the table handle.

IntFieldNumber
: integer value corresponding to the progressive field number.

Returned value

StrFieldValue
: shown field value.

Notes

None.

Example

//It opens a table
UnaTabella:=TableOpen('c:\invoices\index','invoices.db'); 

name:=TablegetFieldname(UnaTabella,1);

//It orders the table according to a field
TableSetIndex(UnaTabella, name); 



//It stores the index 1 field data
FieldValue:='Smith';

//It looks for data within the table and places itself on the record
TableFindNearest(UnaTabella,FieldValue);

//It stores the table field value into a variable 
FoundValue:=TableGetField(UnaTabella,1);

// If the table value is different than the field one then…
If FoundValue<>FieldValue Then
Begin

//It sets the table insert mode   
TableInsert(UnaTabella);  
 
//It stores the field value in a new record  
TableSetField(UnaTabella,1,FieldValue);  
 
//It confirms the table change   
TablePost(UnaTabella);  
End;

// It closes the table
TableClose(UnaTabella);