|
![]() |
![]() |
version 2003
PA_CreateRecord (tableNum)
Parameter | Type | Description | |
tableNum | short | → | Table number |
Description
The routine
PA_CreateRecord
does the same thing than the 4D command
CREATE RECORD
: it creates a new empty record for the table specified by
tableNum
. The new record is resident only in memory and becomes the current record of the table for this process.
All the fields of the new record are initialized with their default values e.g. empty strings for alphanumeric fields and zeros for numeric fields. Before saving the record the 4D Extension would typically store values into the fields of the record using the
PA_SetxxxField
routines.
A call to
PA_CreateRecord
is usually followed by a call to
PA_SaveRecord
which saves the record once the values of the fields in the record have been set.
The record is not saved on the disk unless the 4D Plug-in calls
PA_SaveRecord
or the
SAVE RECORD
command is invoked from within 4th Dimension.
If the 4D Extension changes the current record for the table before saving the new record the new record is lost.
The error checking is made by calling
PA_GetLastError
immediately after a call to
PA_CreateRecord
. Usually, if an error occurs, it will be a because
tableNum
is out of range (
eInvalidFileNumber
).
See Also
PA_SaveRecord , PA_SetBooleanField , PA_SetTextField .
Error Handling
Use
PA_GetLastError
to see if an error occurred (most often
eInvalidFileNumber
).