TableInsert

Top  Previous  Next

Prototype

 

TableInsert (intTableHandle)

 

Description

 

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

 

// Opens a table

TableOne:=TableOpenBDE('c:\invoices\index','invoices.db'); 

 

// Order the table according to a field

TableSetIndex(TableOne,'Code'); 

 

targetcode:='98746';

 

// Search for the second field data in the table and it places itself on the record.

TableFindNearest(TableOne,targetcode);

 

// Store the table field value into variable

FoundValue:=TableGetFieldByName(TableOne,'Code');

 

// If the table value is different than the field one then…

If FoundValue<>targetcode Then

Begin

 

// Set the table insert mode

TableInsert(TableOne);

 

// Store the field value in a new record

TableSetFieldByName(TableOne,'Fiscal Code', targetcode);

 

// Confirm the table change

TablePost(TableOne);

End;

 

// Close the table

TableClose(TableOne);