SETCOLTIME action


Function
The action allows defining a time of values in the defined structure column.
Declaration
 SETCOLTIME  _srcRec^DateTimeCol, _dstRec, _dstRecColIdx
Parameters
_srcRecinColumn identifier determining a target column used for acquiring times.
_dstRecoutLocal structure identifier determining a target structure used for setting the times.
_dstRectColIdxinIdentifier of the Int type.
Description

The action sets a time for each value in the local structure _dstRec - the column with the serial number _dstRecCol, according to the time of a value in corresponding column _srcRec^DateTimeCol. The structures _dstRec and _srcRec must have the same number of rows.

The action represents a substitution for the following loop:

 
RECORD (SD.Def) _srcRec
 RECORD (SD.Def) _dstRec
 
 BEGIN
   REDIM _srcRec[10]
   REDIM _dstRec[10]
 
 
 ; Activity of SETCOLTIME action
   IF _srcRec\DIM # _dstRec\DIM THEN
     ; The error _ERR_RANGE_ERROR
     END
   ENDIF
   INT _row
   _row := 1
   DO_LOOP
     EXIT_LOOP _row > _srcRec\DIM
     IF ! _srcRec[_row]^TimeCol\VLD THEN
       ; Error
       END
     ENDIF
     _dstRec[_row]^ValueCol := _dstRec[_row]^ValueCol TIME _srcRec[_row]^TimeCol
     _row := _row + 1
   END_LOOP
 ; End of the action
 
 END 
 

The type of the column TimeCol used in the example must be Absolute time.

Example

The following example executes the loop described above using the action SETCOLTIME. It assumes, that the serial number of the column ValueColje is 2.

 
SETCOLTIME _srcRec^TimeCol, _dstRec, 2

Related pages:

0 komentárov

Nie ste prihlásený. Akékoľvek zmeny, ktoré vykonáte, sa označia ako anonymné. Ak už máte svoj účet, pravdepodobne sa budete chcieť prihlásiť .