COPYSTRUCT action
Related pages:
COPYSTRUCT _dstStruct, _fromRow, _firstRowToCopy[, _lastRowToCopy]
COPYSTRUCT _dstStruct, _fromRow, _srcStruct
_dstStruct | in/out | Identifier of local variable of Record type - destination structure. |
_fromRow> | in | Identifier of Int type - first row in destination structure (_dstStruct). Specified row, rows or whole structure will be copied (inserted) to destination structure from it (including). |
_firstRowToCopy | in | Identifier of a row of source local variable - first row to be copied. |
_lastRowToCopy | in | Optional parameter - identifier of a row of source local variable - last row to be copied. Note: If the parameter is not specified, the action will copy just the row specified by the parameter _firstRowToCopy. |
RECORD (SD.ArchData) _src RECORD (SD.ArchData) _dst INT _idx BEGIN ; fill source variable with values from 1 to 10 REDIM _src[10] _idx := 1 DO_LOOP EXIT_LOOP _idx > _src\DIM _src[_idx]^value := _idx _idx := _idx + 1 END_LOOP ; set the size of destination variable REDIM _dst[11] ; copy one row from structure _src to 4th row of structure _dst ; _dst[4] <-- _src[5] COPYSTRUCT _dst, 4, _src[5] ; copy two rows from structure _src to structure _dst (from 3rd row down) ; _dst[3] <-- _src[5] ; _dst[4] <-- _src[6] COPYSTRUCT _dst, 3, _src[5], _src[6] ; copy all rows from structure _src to structure _dst (from 2nd row below) ; _dst[2] <-- _src[1] ; _dst[3] <-- _src[2] ; _dst[4] <-- _src[3] ; ... COPYSTRUCT _dst, 2, _src END
Related pages:
Pridať komentár