home *** CD-ROM | disk | FTP | other *** search
-
- *************** PROGRAM LISTING 3A *****************
- * Sleep.PRG
- * A program stub for testing the pause() function written in C
-
- * Author: Jack Ho
- * Occupation: Network Planning Officer
- * Canada Post Corporation
- * Member: VCDA
- * Date: September 1, 1990
-
- * To be placed in public domain with no strings attached
- * Disclaimer - No warranty whatsoever. Use it at your own risk
-
- * Clipper compiling command: CLIPPER SLEEP -m
-
- CLEAR
- secs = 0
- @ 10, 10 SAY "Number of seconds to sleep? " GET secs PICT "99"
- READ
- pause(secs)
- RETURN
-
-
- *************** PROGRAM LISTING 3B *****************
- /* pausekey.c - function to replace the Clipper INKEY(<expN>) */
- /* but not the INKEY(0). A DBXL SLEEP simulation */
-
- /* MS Quick C compiling command: qcl /c /Gs /AL /Zl pausekey.c */
- /* Linking command: link /NOE sleep pausekey ,,, clipper.lib + */
- /* extend.lib + llibce.lib */
-
- #include <time.h>
- #include <stdio.h>
- #include "nandef.h"
- #include "extend.h"
-
- extern long time ();
-
- CLIPPER pause (seconds)
- int seconds;
- {
- int nothing = 0;
- long kount;
- time (&kount);
- seconds = _parni (1);
-
- while ((time ((long *) NULL) - kount) < seconds)
- {
- /* executing the "do nothing" loop until time's up */
- }
- _retni (nothing);
- }