home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PASCAL
/
MADTRB21.ZIP
/
DOSVERSN.SRC
< prev
next >
Wrap
Text File
|
1985-10-19
|
2KB
|
48 lines
{->>>>DOSVersion<<<<-------------------------------------------}
{ }
{ Filename: DOSVERSN.SRC -- Last modified 10/20/85 }
{ }
{ This routine returns the current DOS version as a real }
{ number. It uses DOS call 48. If you are using DOS 2.1 it }
{ will return the value 2.1. If you need to test only the }
{ major or minor portions of the DOS version number, pull the }
{ real number value apart with the Frac and Int functions: }
{ }
{ MajorDOSVersion := Int(DOSVersion); }
{ MinorDOSVersion := Frac(DOSVersion); }
{--------------------------------------------------------------}
FUNCTION DOSVersion : Real;
TYPE
Reg = RECORD
CASE Boolean OF
False : (Word : Integer);
True : (LoByte,HiByte : Byte)
END;
Regpack = RECORD
AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Reg
END;
String15 = String[15];
VAR
I : Integer;
R : Real;
Dummy1,Dummy2 : String15;
Registers : Regpack;
BEGIN
Registers.AX.HiByte := 48;
MSDOS(Registers);
WITH Registers DO
BEGIN
Str(AX.LoByte,Dummy1);
Str(AX.HiByte,Dummy2);
END;
Dummy1 := Dummy1 + '.' + Dummy2;
Val(Dummy1,R,I);
DOSVersion := R
END;