Consultor Eletrônico



Kbase P96416: 4GL code example for executing a Progress program at a certain time
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   01/08/2005
Status: Unverified

GOAL:

How to execute a Progress program at a certain time

FIX:

/*Simple 4GL code example. */
DEF VAR n AS INT INITIAL 3.
DEF VAR t AS INT .
DEF VAR h AS INT.
DEF VAR m AS INT.
DEF VAR s AS INT.
DEF VAR d AS INT LABEL "Seconds ".
DEF VAR w AS CHAR LABEL "Time to execute the command".
t = TIME .
w = STRING(t,"hh:mm:ss").
UPDATE w.
h = INT(SUBSTRING(w,1,2,"CHARACTER")).
m = INT(SUBSTRING(w,4,2,"CHARACTER")).
s = INT(SUBSTRING(w,7,2,"CHARACTER")).
d = (h * 3600) + (m * 60) + s .
n = d - TIME.
IF n > 0 THEN DO :
PAUSE n.
RUN test.p .
END.