home *** CD-ROM | disk | FTP | other *** search
- {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
- The purchaser of these procedures and functions may include them in COMPILED
- programs freely, but may not sell or give away the source text.
-
- The parameter to function DiskType is the drive letter, or '@' for the default
- drive. The output is the number of K the disk is formatted for
- (360, 320, 180, 160) or one of two error numbers:
-
- error 0 indicates an invalid drive number
- error 1 indicates a non-standard format
-
- NOTE that any file that INCLUDES this file must also INCLUDE
- the type definitions in REGPACK.TYP}
-
- {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
-
-
- function DiskType(which : char):integer;
-
- var
- regs : regpack;
- begin
- with regs do
- begin
- DX := ord(UpCase(which)) - 64; { This gives 1 for A, 2 for B,
- &c. Since @ is the ASCII char
- just before A, @ gives 0, which
- is the code for the default drive.}
- AX := $36 shl 8;
- MSDOS(regs); { call DOS function $36 }
- if AX = $FFFF then
- DiskType := 0
- else
- begin
- case DX of
- $162: DiskType := 360; { See the DOS 2.0 manual, Appendix D }
- $15F: DiskType := 180;
- $13B: DiskType := 320;
- $139: DiskType := 160;
- else DiskType := 1;
- end; {case}
- end;
- end; {with}
- end;
-
-
-
-
-