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
Pridať komentár