Category : Files from Magazines
Archive   : BYTE0288.ZIP
Filename : RUN.PAS
RUN.PAS accompanies the review, "Turbo Pascal 4.0," by Walter Banks, BYTE, February 1988, page 153.
PROGRAM Run;
{$M $2000,0,0 }
{ Run V1.0
(c) Copyright November 1987
Byte Craft Limited
421 King Street North
Waterloo, Ontario Canada N2J 4E4
(519) 888-6911
Walter Banks.
Run is used to time programs running under MS-DOS
To run type:
RUN filename [commandline]
Revision History:
1) V1.0 7 November 1987 Initial version.
}
USES DOS;
CONST
Version = '(c) Byte Craft Limited V1.0';
VAR
FName : String;
CLine : String;
i : INTEGER;
p : ^STRING;
ExecutionTime : REAL;
sh,sm,ssec,ssec100 : word;
eh,em,esec,esec100 : word;
FUNCTION FindFile(s : STRING) : BOOLEAN;
VAR
InFile : FILE;
z : BOOLEAN;
BEGIN
Assign(InFile,s);
{$I-}
Reset(InFile);
{$I+}
z := (IOResult = 0);
IF z THEN Close(inFile);
FindFile := z;
END;
BEGIN
IF paramcount > 0
THEN
BEGIN
FName := paramstr(1);
p := Ptr(PrefixSeg,$80);
CLine := p^;
Delete(CLine,1,POS(FName,CLine) + Length(FName));
END
Else
Begin
WRITELN('Run ',version);
WRITELN(' Useage: RUN filename [CommandLine]');
WRITELN;
Write('Enter file name to run : ');
Readln(FName);
Write('Enter command line ([ENTER] none) : ');
Readln(CLine);
End;
IF Pos('.',FName) = 0
THEN IF FindFile(FName + '.EXE') THEN FName := FName + '.EXE'
ELSE IF FindFile(FName + '.COM') THEN FName := FName + '.COM'
ELSE IF FindFile(FName + '.BAT') THEN FName := FName + '.BAT';
GetTime(sh,sm,ssec,ssec100);
EXEC(FName,CLine);
GetTime(eh,em,esec,esec100);
WRITELN;
ExecutionTime := ((eh*3600.0) + (em*60.0) + esec + (esec100/100.0))
-((sh*3600.0) + (sm*60.0) + ssec + (ssec100/100.0));
WRITELN('RUN ',version);
WRITELN('Filename : ',FName,' Execution Time '
,ExecutionTime:6:2,' seconds '
,' DOS return code ',DosError);
END.
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/