home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
t
/
tspa3150.zip
/
TSUNTH.INT
< prev
next >
Wrap
Text File
|
1992-06-13
|
6KB
|
156 lines
{$B-,D-,F-,I+,N-,R-,S+,V+}
(*
Timo Salmi UNiT H
A Turbo Pascal unit of system information and more miscellania
All rights reserved 24-Feb-90
Updated 15-Apr-90, 23-Jul-90, 1-Aug-90, 8-Aug-90, 5-Jan-90, 22-Jul-91
24-Nov-91
In the 24-Nov-91 update part of the old routines has been transferred to
TSUTNTJ because this TSUNTH unit started to grow too much. The transferred
routines were
COPYFILE Copy a file from within a Turbo Pascal program
ISDIRFN Is a name a directory or not
OPENEDFN Is an assigned textfile still open or not
PIPEDIFN Is the standard input from redirection
PIPEDNFN Is the standard output redirected to nul
PIPEDOFN Is the standard output redirected
This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
NON-INSTITUTIONAL purposes, provided it is not changed in any way. For
ANY other usage, such as use in a business enterprise or a university,
contact the author for the terms of registration.
The units are under development. Comments and contacts are solicited. If
you have any questions, please do not hesitate to use electronic mail for
communication.
InterNet address: ts@chyde.uwasa.fi (preferred)
Funet address: GADO::SALMI
Bitnet address: SALMI@FINFUN.BITNET
The author shall not be liable to the user for any direct, indirect or
consequential loss arising from the use of, or inability to use, any unit,
program or file howsoever caused. No warranty is given that the units and
programs will work under all circumstances.
Timo Salmi
Professor of Accounting and Business Finance
Faculty of Accounting & Industrial Management; University of Vaasa
P.O. BOX 297, SF-65101 Vaasa, Finland
*)
unit TSUNTH;
(* ======================================================================= *)
interface
(* ======================================================================= *)
uses Dos
{$IFDEF VER40}
,TSUNT45
{$ENDIF}
;
(* ====================================================================
Software information
==================================================================== *)
(* Graftabl MsDos command loads the extended character set to be used in
the graphics mode. This function tells whether the table has been
already loaded, or not *)
function GRTABLFN : boolean;
(* Returns the country code if MsDos 3+. For an error and earlier MsDos
versions returns zero. See MsDos manual "How to use Code Pages" for
the country codes *)
function COUNTRFN : word;
(* Return the country-dependent date format, reguires 3.0+,
Principal return formats: MM-DD-YY ('-' or whatever is the
DD-MM-YY relevant separator)
YY-MM-DD
On error or MsDos < 3.0 returns ('XX*XX*XX');
Norton & Wilton ss. 358-360, 412, Duncan 395-398, Dettmann 586 *)
function DATEFMFN : string;
(* Return the country-dependent time format, reguires 3.0+,
Principal return formats: 12-hour HH:MM:SS (':' or whatever is the
24-hour HH:MM:SS relevant separator)
On error or MsDos < 3.0 returns ('00h');
Norton & Wilton ss. 358-360, 412, Duncan 395-398, Dettmann 586 *)
function TIMEFMFN : string;
(* Returns from which drive the system was booted, requires MsDos 4.0+,
else returns '.' *)
function BOOTDRFN : char;
(* ====================================================================
Hardware information
==================================================================== *)
(* Is a math coprocessor present. And, yes, yes, I know that there is a
Test8087 variable in Turbo Pascal, but I have found it unreliable *)
function MATHCOFN : boolean;
(* Number of serial ports *)
function RS232FN : byte;
(* Number of parallel ports (printers installed) *)
function PARPORFN : byte;
(* Is mouse hardware and driver present, a simple true / false test *)
function ISMOUSFN : boolean;
(* Status of the mouse hardware and driver
0 : no mouse
1 : mouse with other than two buttons
2 : mouse with two buttons
3 : Mouse Systems or Logitech mouse
4 : Unknown or unresolved mouse status *)
function MOUSTAFN : byte;
(* Returns the type of the processor chip. If not known, returns the
string 'error'. This function is based on the public inline code in
Michael Tischer, PC System Programming for Developers, Abacus, p. 660.
I have written the interface to it. Does not detect 80486. Sometimes
gives conflicting information. Use with care, if at all. There are
alternatives *)
function CHIPFN : string;
(* Get the version (date) of the ROM BIOS. It is of the format mm/dd/yy.
Returns 'NotKnown' if unavailable *)
function ROMDTEFN : string;
(* Is the keyboard an enhanced keyboard *)
function ISENHAFN : boolean;
(* Last drive of the system, softcoded, not for XTs *)
function LASTDRFN : char;
(* This function gives the interleave factor of a given drive.
If you give a non-existent drive name, interlfn return zero.
This is for fixed disks. Applying on a floppy drive will give
nonsensical values, not for XTs. I am not convinced that this
works with all the different conrollers around *)
function INTERLFN (drive : char) : byte;
(* Number of FATs, not for XTs *)
function FATSFN (drive : char) : byte;
(* Number of cylinders on a device, requires MsDos 3.2+.
In case of modia not present, error, or wrong MsDos version,
returns 0 *)
function NRCYLFN (drive : char) : byte;
(* ====================================================================
Perform tasks
==================================================================== *)
(* Convert an Asciiz (#0 limited) string into an ordinary ascii string.
Some of the routines in this unit internally need Z2ASCFN, but why
not make it also generally available as well *)
function Z2ASCFN (asciiz : string) : string;