(******************************************************************* Procedure to abort process in case of error; with message. *******************************************************************) procedure Abort ( S : string ) ; begin writeln ( 'Message : ' , S , #7#7#7 ) ; Halt ( 1 ) ; end ; (******************************************************************* Convert string to upper case. *******************************************************************) function Upper ( S : string ) : string ; var temp : string ; B : byte ; begin temp := S ; for B := 1 to length ( S ) do temp [ B ] := UpCase ( temp [ B ] ) ; Upper := temp ; end ; (******************************************************************* Returns a byte for the drive letter, where 1 thru 26 = A: thru Z: *******************************************************************) function DriveNum ( S : string ) : byte ; begin DriveNum := 0 ; if pos ( ':' , S ) <> 2 then EXIT ; DriveNum := ord ( UpCase ( S [ 1 ] ) ) - 64 ; end ; (******************************************************************* Check that this program is an EXE file AND is on drive A: *******************************************************************) function IsDriveA ( S : string ) : boolean ; begin IsDriveA := DriveNum ( S ) = 1 ; end ;