home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cenvi23.zip / OS2TIME.CMD < prev    next >
OS/2 REXX Batch file  |  1995-03-28  |  950b  |  23 lines

  1. EXTPROC CEnvi2
  2. /***********************************************************************
  3.  *** OS2Time - CEnvi2 example program for showing the OS2 system time ***
  4.  *** ver.1     through calls to the system.  Note that time could    ***
  5.  ***           also be obtained more easily through the C-standard   ***
  6.  ***           library time routines; this example is simply to show ***
  7.  ***           how to use some of the more powerful CEnvi2 features.  ***
  8.  ***********************************************************************/
  9.  
  10. #include <DosCalls.lib>    // include the DosGetDateTime() call
  11.  
  12. printf("Displaying OS/2 system time; press any key to end:\n")
  13.  
  14. while( !kbhit() ) {
  15.    DosGetDateTime(dt)
  16.    printf("\r%2d:%02d:%02d.%02d",BLObGet(dt,0,UWORD8),BLObGet(dt,1,UWORD8),
  17.                                  BLObGet(dt,2,UWORD8),BLObGet(dt,3,UWORD8))
  18. }
  19.  
  20. while( kbhit() ) getch()         // flush keyboard buffer
  21. printf("\n")
  22.  
  23.