TableInsert
Previous  Top  Next

Prototype

TableInsert (intTableHandle)

Description

It sets the insert mode for the table.

Parameters

IntTableHandle
: integer value corresponding to the table handle.

Returned value

None.

Notes

The table insert mode refers to the current record, by moving from a record to another one, there is a return to the consultation mode.
Use the TablePost command in order to confirm the insertions, while to cancel them use the TableCancel command.



Example

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

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

targetcode:='98746';

//It looks for the second field data in the table and it places itself on the record. 
TableFindNearest(UnaTabella,targetcode);

//It stores the table field value into variable
FoundValue:=TableGetFieldByName(UnaTabella,'Code');

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

//It sets the table insert mode   
TableInsert(UnaTabella);  
 
//It stores the field value in a new record   
TableSetFieldByName(UnaTabella,'Fiscal Code', targetcode);  
 
//It confirms the table change   
TablePost(UnaTabella);  
End;

// It closes the table
TableClose(UnaTabella);