sleep() auf der AS/400 funktioniert tatsächlich anders.
Diese Funktion ist auf jedem System anders implementiert und hängt häufig von TICKS-Parameter ab.
Auf der AS/400 ist das leider 1 Sekunde, unter Windows 1/1000-Sekunde, unter Unix/Linux (eben je nach Implementation) auch schom mal 1/60-Sekunde.
Doch hier nun für alle RPG-ILE-Freaks:
Code:
hactgrp(*caller) dftactgrp(*no) bnddir('QC2LE')
d WaitTime pr extproc('waittime')
d pMI_Time 8
d pMI_Options 5U 0 value
d WaitInterval ds 8
d WaitPart1 10U 0
d WaitPart2 10U 0
d WAIT_NORMAL c const(0)
d WAIT_MOD_AS_ENTER...
d c const(32768)
d WAIT_MOD_AS_LEAVE...
d c const(16384)
d WAIT_MPL_SET c const(8192)
d WAIT_SIGNALS c const(4096)
d WaitOptions s 5U 0 inz(WAIT_NORMAL)
d WaitFactor s 15p 5
d WaitMSeconds s 21p 0
c *entry plist
c parm WaitFactor
c
c eval WaitMSeconds = WaitFactor * 1000000
c if WaitMSeconds = *zero
c return
c endif
c
c eval WaitPart1 = %div(WaitMSeconds:1048576)
c eval WaitPart2 = %rem(WaitMSeconds:1048576) * 4096
c
c callp WaitTime(WaitInterval:WaitOptions)
c return
Das Aufsplitten des Intervals liegt in der internen Darstellung eines Zeitwertes in Microsekunden (1/1000000) in den Bits 1-56 (57-64 = *4096) müssen 0 sein.
Bookmarks