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_ontickn( [ <nseconds> [, <cprocedure>|<nkey> ] ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_ONTICKn( [ <nSeconds> [, <cProcedure>|<nKey> ] ] )
where n is 1 or 2.


Parameters

<nSeconds>
Frequency with which the procedure will be called. Can be from 0.1 to 
921, 825 seconds (just over 256 hours, or more than 10 days).

<cProcedure>
Name of a procedure to execute.

<nKey>
ASCII value of a key to stuff onto the keyboard.


Returns

The time remaining until the procedure is called again.


Description

NetLib contains two identical timer functions, N_ONTICK1() and 
N_ONTICK2(), each of which calls a procedure at a regular 
interval. Because there are two timer functions, it is possible to have 
two timer event traps active at once.

N_ONTICKn(<nSeconds>) with no second parameter alters the time interval 
without changing the procedure. Deactivate the event trap by calling 
N_ONTICKn(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. You cannot use this function to accurately clock 
real-time events. Also keep in mind that the more often a procedure is 
called, the more it will interfere with the normal program execution.


Example

// Display time of day.  Refresh every 10 seconds.
N_ONTICK1(10, 'ShowTime')
.
.
.
PROCEDURE ShowTime
   @ 1, 0 SAY TIME()
RETURN



See Also: N_ONTIME()

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