Porovnávané verzie
porovnané s
Kľúč
- Tento riadok sa pridal
- Riadok je odstránený.
- Formátovanie sa zmenilo.
INSERT action
Function
The action inserts one or several rows into a specified structure.
Declaration
Blok kódu | ||||
---|---|---|---|---|
| ||||
INSERT _struct, beforeIdx, rowsToInsert [, lastRow] |
Parameters
struct | in/out | Whole structure identifier where the row will be inserted to. |
beforeIdx | in | Identifier of the Int type. The inserted row will be inserted before the row specified in this parameter. |
rowsToInsert | in | Whole structure identifier or one row identifier - row(s) to insert. |
lastRow | in | Optional parameter - one row identifier. |
Description
The action inserts:
- a row, if rowsToInsert is the reference to a structure row, or
- rows (whole structure) if rowsToInsert is the reference to a whole structure
Inserting will be performed into the local structure _struct before the row given by the parameter _beforeIdx. If _beforeIdx = _struct\DIM+1 or _beforeIdx = -1, the action will insert the given row(s) in the end of the structure (append). If the value of the parameter _beforeIdx is different, the action will generate the error _ERR_RANGE_ERROR. The structures _struct and rowsToInsert must be of the same type.
If the parameter lastRow is used, the action will copy the source structure rows determined by the parameters rowsToInsert and lastRow. In this case both the parameters must represent a row of the same structure.
Example:
Blok kódu | ||||
---|---|---|---|---|
| ||||
RECORD (SD.RecordDef) _struct RECORD (SD.RecordDef) _rowsToInsert INT _beforeIdx REDIM _struct[10] REDIM _rowsToInsert[2] ; inserting 1st row in the beginning INSERT _struct, 1, _rowsToInsert[1] ; inserting 2nd row at the end _beforeIdx := _struct\DIM+1 INSERT _struct, _beforeIdx , _rowsToInsert[2] ; inserting the whole structure rowsToInsert in the beginning INSERT _struct, 1 , _rowsToInsert |
Example 2
Inserting the 1st and 2nd rows of the structure _rowsToInsert at the beginning of the structure _struct.
Blok kódu | ||||
---|---|---|---|---|
| ||||
INSERT _struct, 1, _rowsToInsert[1], _rowsToInsert[2] |