home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / MISC / FIRST.ZIP / FIRST.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1990-10-10  |  924 b   |  39 lines

  1. program first;  { Program to see if this is the first time the
  2.                   computer has been turned on for the first time
  3.                   in a day. }
  4.  
  5. uses
  6.     dos;
  7. var
  8.     year, month, day, dayofweek : word;     { system date }
  9.     f : text;
  10.     d  : datetime;                          { last sign on date }
  11.     srec : searchrec;
  12.  
  13. BEGIN
  14.    getdate ( year, month, day, dayofweek );
  15.    findfirst ( 'SIGN_ON.BAT', anyfile, srec );
  16.    unpacktime ( srec.time, d);
  17.  
  18.    assign  ( f, 'SIGN_ON.BAT' );
  19.    rewrite(f);
  20.  
  21.  
  22.    if ( year = d.year ) and ( month = d.month ) and ( day = d.day ) then
  23.       writeln (f, 'SET FIRST=NO')
  24.    else
  25.       writeln (f, 'SET FIRST=YES');
  26.    close (f);
  27. END.
  28.  
  29.      {   Usage:
  30.             put first in a batch file then run SIGN_ON.BAT, for example
  31.  
  32.       FIRST
  33.       CALL SIGN_ON
  34.       IF %FIRST%==YES goto :first_time_today
  35.       .
  36.       .
  37.       .
  38.      }
  39.