Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_onexpr(<nseconds>, <cprocedure>, <clogicalexpression>) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_ONEXPR(<nSeconds>, <cProcedure>, <cLogicalExpression>)


Parameters

<nSeconds>
Sets the frequency with which to evaluate the third parameter. Can be 
from 0.1 to 921, 825 seconds (just over 256 hours, or more than 10 
days). 

<cProcedure>
Name of the procedure to execute.

<cLogicalExpression>
Expression to evaluate. (Passed as a string.)


Returns

NIL


Description

Evaluates a logical expression every <nSeconds> and calls a procedure 
when the expression evaluates to true.

The expression must be passed as a character string. If it is not a 
valid expression, a Clipper error will occur.

N_ONEXPR(<nSeconds>) with no second parameter alters the time interval 
without changing the procedure. Deactivate the event trap by calling 
N_ONEXPR(0). You should disable it as soon as you no longer need it.

The event trap is active during a wait state and also while Clipper is 
executing commands such as INDEX ON. However, the event will not be 
processed when Clipper is not in control, as when you RUN a DOS 
command, or during stream I/O, as when you issue COPY FILE. In those 
cases the event will be handled as soon as the external operation has 
been completed.

Timing is not precise, so you cannot use this function to clock real-
time events accurately. Also keep in mind that the more often an 
expression is evaluated, the more often normal program execution will 
be interrupted.


Example

// Call procedure TimeOut when clock reaches 1:00 pm
N_ONEXPR(10, 'TIMEOUT', [TIME() > '13:00:00'])



See Also: N_ONTICKn() N_ONTIME()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson