home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
DELAY.ZIP
/
DELAY.C
next >
Wrap
C/C++ Source or Header
|
1991-06-20
|
935b
|
48 lines
/*
* DELAY - A program to sleep for a specified number of milliseconds
*
* Dave Briccetti, June 20, 1991
*/
#include "stdio.h"
#define INCL_DOSPROCESS
#include <os2.h>
SHORT main (SHORT cArgs, PSZ apszArgs[])
{
BOOL fParmsValid = FALSE;
LONG lDelayMilliseconds;
SHORT Rc;
/*
* Verify that one argument is provided, and that it is valid
*/
if (cArgs == 2)
if (sscanf (apszArgs [1], "%ld", &lDelayMilliseconds) == 1)
if (lDelayMilliseconds >= 0)
fParmsValid = TRUE;
/*
* Call DosSleep if arg is valid, otherwise show an error message
*/
if (fParmsValid)
{
DosSleep (lDelayMilliseconds);
Rc = 0;
}
else
{
puts ("Syntax: DELAY n");
puts (" Where 'n' is the number of milliseconds to delay");
Rc = 1;
}
return Rc;
}