home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progpas
/
tspas18.arj
/
TSUNTE.INT
< prev
next >
Wrap
Text File
|
1990-02-24
|
4KB
|
112 lines
{$B-,D-,F-,I+,N-,R-,S+,V+}
(*
Timo Salmi UNiT E
All rights reserved 19-Aug-89,
Updated 25-Sep-89, 8-Oct-89, 4-Nov-89, 6-Dec-89, 24-Feb-90
Cursor routines, keyboard status, configuration information, file information,
calendar routines.
TSUNTE first appears in release TSPAS13 of my Turbo Pascal units package.
I have transferred to TSUTNTE the procedures and functions which formerly
were in TSUNTA or TSUNTC, but which do not utilize Turbo Pascal Crt unit.
This makes for better compatibility on less than truly compatible PCs.
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, contact the author.
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
FidoNet address: 2:515/1 (Micro Maniacs Opus, To: Timo Salmi)
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
School of Business Studies, University of Vaasa
P.O. BOX 297, SF-65101 Vaasa, Finland
*)
unit TSUNTE;
(* ======================================================================= *)
interface
(* ======================================================================= *)
uses Dos;
(* Turns cursor off, and (since the update tspas13) retains the original
cursor size behind the scenes *)
procedure CURSOFF;
(* Restores the cursor as it was before cursoff (unless, of course, you
have manipulated cursor size yourself in between) *)
procedure CURSON;
(* Turns cursor on using user defined cursor size, the ordinary
color monitor CGA and EGA values are 6 and 7; VGA: 13,14 *)
procedure CURSOR (LowerScanLine, UpperScanLine : byte);
(* Turns on a colored border, CGA and VGA, not EGA *)
procedure BORDER (color : byte);
(* Clear the keyboard typeahead buffer *)
procedure CLB;
(* Is the monitor a monochrome monitor, if false, then color monitor *)
function MONOFN : boolean;
(* Is CapsLock on *)
function CAPSONFN : boolean;
(* Is NumLock on *)
function NUMLONFN : boolean;
(* Does a file exist. Detects also read-only and/or hidden files.
If the name is a directory, false is returned, since directory
is not considered a file.
IMPORTANT: Never apply on an open file! *)
function FEXISTFN (fnimi : string) : boolean;
(* The size of any file in bytes. In case of an error, returns -1
IMPORTANT: Never apply on an open file! *)
function FSIZEFN (filename : string) : longint;
(* Space to files is allocated in whole clusters rather than by byte.
This function gives the cluster size of a device.
In case of an error, the function returns -1. *)
function CLUSIZFN (device : char) : longint;
{$IFNDEF VER40} (* Not Turbo Pascal 4.0 *)
(* The size of a file in total allocated bytes.
In case of an error, returns -1
IMPORTANT: Never apply on an open file! *)
function ALLSIZFN (filename : string) : longint;
{$ENDIF}
(* Returns the entire command line, first appearance in tspas14.arc
IMPORTANT: Must be applied before any file access *)
function CMDLNFN : string;
(* Modern weekday based on Zeller's congruence, valid after 14-Sep-1752,
Sun = 0, Mon = 1 ,..., Sat = 6 *)
function WKDAYFN (day, month, year : word) : byte;
(* This function returns the weeknumber of a given date.
If you consider that it starts on Sunday, set sunday_is_first true.
If you consider that the week starts on Monday, set sunday_is_first false.
This function was programmed by Seppo Pynnönen, Ph.D.,
University of Vaasa, Finland, sjp@chyde.uwasa.fi *)
function WEEKNRFN (day, month, year : word;
sunday_is_first : boolean) : integer;