home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power CD-ROM!! 7
/
POWERCD7.ISO
/
dos
/
term150
/
0150ter2._xe
/
PASCAL.EXE
/
STARTIME.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-09-10
|
1KB
|
46 lines
{$M 4096,0,1024}
{ Terminate help file }
{ Made 1993 by Bo Bendtsen }
Uses Dos,Crt;
Var
Param : String;
ph, pm : Word;
h,m,s,hu : Word;
ch : Char;
Function StrToInt(S: String) : LongInt;
Var Kode,i : Integer;
Begin
If Length(S) = 0 Then StrToInt := 0 Else Begin Val(S,i,Kode);
If Kode = 0 Then StrToInt := i Else StrToInt := 0; End;
End;
Function IntToNulStr(i: LongInt;b:Byte): String;
Var S : String[11];
Begin
Str(i, S); While Length(S)<b Do S:='0'+S;
If Length(S)>b Then S:='?'+Copy(S,Length(S)-b+2,10); IntToNulStr:=S;
End;
Begin
WriteLn(#13#10'Another Terminate utility');
If Paramcount<2 Then
Begin
WriteLn(#13#10#10'Start program at time. Syntax: STARTIME HH:MM Program parameters');
WriteLn('STARTIME 03:00 TERMINAT /BOSS:1');
Halt;
End;
Param:=ParamStr(1); ch:=#0;
ph:=StrToInt(Copy(Param,1,2)); pm:=StrToInt(Copy(Param,4,2));
Param:=''; For h:=2 to Paramcount Do Param:=Param+ParamStr(h)+' ';
WriteLn(#13#10#10'Starting: '+Param+' at time '+Paramstr(1));
Repeat
Gettime(h,m,s,hu);
Write(#13+IntToNulStr(h,2)+':'+IntToNulStr(m,2)+':'+IntToNulStr(s,2));
If KeyPressed Then Ch:=Readkey; Delay(250);
Until (ch=#$1B) or ((h=ph) and (m=pm));
If ch<>#$1B Then
Begin SwapVectors; Exec(GetEnv('COMSPEC'),' /C '+Param); SwapVectors; End;
End.