home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
UTIL161.ZIP
/
UTILITY.DOC
next >
Wrap
Text File
|
1992-01-07
|
74KB
|
1,409 lines
{
Utility 16.1
Copyright (C) 1990, 1991 by Gemini Systems
Utility 16.1 (c) Copyright 1990, 1991 by Gemini Systems ALL RIGHTS RESERVED
╒════════════════════════════════════════════════════════════════════════╕
│ This UNIT was written for TURBO PASCAL 6.0 by: │
│ │
│ GEMINI SYSTEMS │
│ 7748 Lake Ridge Drive │
│ Union Lake, MI 48387 │
│ │
│ BBS Support (313) 360-4931 │
│ FAX Support (313) 360-6407 │
│ │
│ Comments, Suggestions or Donations welcome. │
│ │
│ To use in your programs, simply state UTILITY in your uses clause and │
│ compile your program with the $V- compiler directive. │
│ │
│ example: PROGRAM prog_name; │
│ USES utility; │
├────────────────────────────────────────────────────────────────────────┤
│ Modification History: │
│ │
│ Version Number Date Change Made │
│ ───────────────────────────────────────────────────────────────────── │
│ 11.5 09-11-90 Add SAVE_LINE & REBUILD_LINE │
│ 11.6 09-17-90 Modify DAYWEEK procedure │
│ 11.7 10-04-90 Add Program Name to SHOW_VERSION │
│ 11.8 10-13-90 Minor change to READ_REAL │
│ 11.9 10-18-90 Eliminate char 0 in PAD │
│ 12.0 11-21-90 Added FILL_SCREEN, REBOOT and │
│ PROGRAM_LOCATION │
│ 13.1 12-03-90 Conversion to TP v6.0 │
│ Added BLINK_ON, BLINK_OFF, │
│ and VGA_INSTALLED, SCREEN_ON & │
│ SCREEN_OFF │
│ 13.2 12-06-90 Changed SHADOW on POP_WINDOW │
│ 13.3 12-17-90 Added POP_MESSAGE & │
│ POP_WINDOW_TITLE, RESTORE_CURSOR │
│ & TEXTATTR_AT_ENTRY │
│ 13.4 12-22-90 Activate PRINT_SCREEN Procedure │
│ 13.5 02-15-91 Added _WORD function │
│ 14.1 03-30-91 Added READ_STR, SHIFTS_KEYS, │
│ GLOBAL. │
│ 14.2 READ_R, READ_I, READ_L │
│ 14.3 04-06-91 ALT, CNTL added to READCHTIME │
│ 14.4 04-09-91 ADDED READ_MONEY AND READ_DIGIT │
│ 14.5 04-10-91 Modified READ_MONEY to allow │
│ number of decimal places. │
│ 14.6 04-14-91 Speed improvements to READ_MONEY │
│ 14.7 05-10-91 EventHandler, and BLANKS added. │
│ 14.8 05-18-91 Added Control-Alpha Keys │
│ 14.9 05-19-91 Revised default exit-chars │
│ 15.0 05-28-91 Bug in READ_STR RIGHT & LEFT │
│ 15.1 06-06-91 Bug in PRINTER_READY │
│ 15.2 08-04-91 SetBlink (works with CGA) │
│ 15.3 08-16-91 FW Does not scroll at 80,25 │
│ 15.4 10-11-91 Add PackKey & UnPackKey │
│ 15.5 10-18-91 Minor bug in WRITE_DATE │
│ 15.6 10-23-91 Added X_IN & X_OUT │
│ 15.7 10-28-91 Minor speed improvements │
│ 15.8 10-30-91 Add COMMAND_BUFFER │
│ 15.9 11-11-91 Speed up FW │
│ 16.0 11-21-91 Bug in READCH, GOTOXY POP_MESSAGE│
│ 16.1 12-09-91 Add StuffBuffer │
╘════════════════════════════════════════════════════════════════════════╛
}
UNIT UTILITY;
INTERFACE
USES CRT, DOS, PRINTER;
CONST
GEMINI_SYSTEMS : STRING[14] = ' ';
COMMAND_BUFFER : STRING = ''; { If this is <> '' then whenever
you call any of the UTILITY
read procedures, the first
character of this string will
be returned instead of keyboard
input. }
VERSION : STRING[15] = 'UTILITY 16.1'; { Reset in Application if Desired }
{ Example: VERSION := 'V1.0'; }
RESET_CURSOR : BOOLEAN = TRUE; { Cursor will be reset to normal }
{ at exit of program if left TRUE }
ENTER_KEY : STRING[3] = CHR(17)+CHR(196)+CHR(217);
{ The Symbol for Enter Key }
HELP_ATTR : BYTE = $4F; { Color used to display help line below }
HELP_LINE : STRING[79] = ' Alt-F10 for Version Number';
{ If user presses Alt key this line is displayed }
{ Set this to '' to de-activate this option }
HELP_ATTR2 : BYTE = $4F; { Color used to display help line below }
HELP_LINE2 : STRING[79] = ' No Control Keys defined';
{ If user presses CtrL key this line is displayed }
{ Set this to '' to de-activate this option }
EventHandler : POINTER = NIL; { Set this pointer to the address of any
procedure and that procedure will be
called after every keypress handled
by any of the read commands in this
utility. THIS PROCEDURE MUST BE
COMPILED WITH THE $F+ DIRECTIVE. }
FUNC1 = #127;
FUNC2 = #128;
FUNC3 = #129;
FUNC4 = #130;
FUNC5 = #131;
FUNC6 = #132;
FUNC7 = #133;
FUNC8 = #134;
FUNC9 = #135;
FUNC10 = #136;
FUNC11 = #137;
FUNC12 = #138;
AF1 = #139; { ALT-F1 }
AF2 = #140;
AF3 = #141;
AF4 = #142;
AF5 = #143;
AF6 = #144;
AF7 = #145;
AF8 = #146;
AF9 = #147;
AF10 = #148;
AF11 = #149; { Future Use Only }
AF12 = #150; { Future Use Only }
ALT_A = #151;
ALT_B = #152;
ALT_C = #153;
ALT_D = #154;
ALT_E = #155;
ALT_F = #156;
ALT_G = #157;
ALT_H = #158;
ALT_I = #159;
ALT_J = #160;
ALT_K = #161;
ALT_L = #162;
ALT_M = #163;
ALT_N = #164;
ALT_O = #165;
ALT_P = #166;
ALT_Q = #167;
ALT_R = #168;
ALT_S = #169;
ALT_T = #170;
ALT_U = #171;
ALT_V = #172;
ALT_W = #173;
ALT_X = #174;
ALT_Y = #175;
ALT_Z = #176;
CF1 = #200; { CONTROL-F1 }
CF2 = #201;
CF3 = #202;
CF4 = #203;
CF5 = #204;
CF6 = #205;
CF7 = #206;
CF8 = #207;
CF9 = #208;
CF10 = #209;
CF11 = #210; { Future Use Only }
CF12 = #211; { Future Use Only }
C_A = #1; { CONTROL-A }
C_B = #2;
C_C = #3;
C_D = #4;
C_E = #5;
C_F = #6;
C_G = #7;
C_H = #8;
C_I = #9;
C_J = #10;
C_K = #11;
C_L = #12;
C_M = #13;
C_N = #14;
C_O = #15;
C_P = #16;
C_Q = #17;
C_R = #18;
C_S = #19;
C_T = #20;
C_U = #21;
C_V = #22;
C_W = #23;
C_X = #24;
C_Y = #25;
C_Z = #26;
PGUP = #178;
PGDN = #179;
UP = #180;
DOWN = #181;
LEFT = #191;
RIGHT = #192;
BACKUP = #194;
HOMEKEY = #196;
ENDKEY = #197;
INSKEY = #198;
DELKEY = #199;
BACKSPACE= #8;
TAB = #9;
ENTER = #13;
RETURN = #13;
ESCAPE = #27;
TYPE
STR2 = STRING [2];
STR3 = STRING [3];
STR8 = STRING [8];
STR16 = STRING [16];
STR20 = STRING [20];
STR80 = STRING [80];
BUFFER = ARRAY [1..4000] OF CHAR; { Use for calls to SAVE_SCREEN }
BUF160 = ARRAY [1..160] OF BYTE; { Use for calls to SAVE_LINE }
LINE_SET = SET OF 1..80; { Use for calls to SET_ATTR }
CURTYPE = (BLOCK, { Use for calls to SET_CURSOR }
UNDERLINE,
NONE,
HALF);
ETYPE = SET OF CHAR;
CTYPE = SET OF 1..80;
TYPEN = (RNUM,LNUM,INUM);
UT_TYPE = RECORD
TIMEX : INTEGER;
TIMEY : INTEGER;
TIME_TYPE : CHAR;
DATEX : INTEGER;
DATEY : INTEGER;
DATE_TYPE : CHAR;
INPUT_ATTR : BYTE;
DEFAULT_ATTR : BYTE;
COMPILED_DATE : STR8;
COMPILED_TIME : STRING[5];
NOCONV : BOOLEAN;
EXITCH : ARRAY [1..255] OF BOOLEAN;
END;
VAR
CH : CHAR; { Global CHAR Variable }
NOCONV : CHAR; { If included in EXITCH to READSTR }
{ LEFT or RIGHT is not converted to }
{ UP or DOWN if in first or last
{ position. }
CLEAR : CHAR; { If included in EXITCH to READSTR }
{ the value being edited is set to }
{ spaces. }
CGA_PRESENT: BOOLEAN; { Is TRUE if CGA-ABILITY is Present }
EGA_PRESENT: BOOLEAN; { Is TRUE if EGA-ABILITY is Present }
VGA_PRESENT: BOOLEAN; { Is TRUE if VGA-ABILITY is Present }
SHOW_ERROR : BOOLEAN; { If set to FALSE in Application, }
{ Error Handler is De-Activated. }
DOS_VER : STRING [4]; { Contains DOS Version at Startup }
{ i.e. "3.31" }
TIME : STR8; { Is set to Current Time at Startup }
DATE : STRING[30]; { Is set to Current Date at Startup }
{ Date & Time are updated when any }
{ of the following routines are }
{ called: }
{ READSTR Updates Time }
{ READSTR_BIG Updates Time }
{ READ_REAL Updates Time }
{ READ_INT Updates Time }
{ READCHTIME Updates Time }
{ WRITE_TIME Updates Time }
{ READCHT Updates Time }
{ WRITE_DATE Updates Date }
TIM : LONGINT; { Is used with START_TIMER at Entry }
{ or can be used by application. }
P : ^BUFFER; { Pointer to Video Memory }
CUR : CURTYPE; { Stores the Current Cursor Shape }
DISPLAY : CHAR;
NUM_INPUTS : INTEGER;
CHANGED : BOOLEAN; { Set to TRUE or FALSE after each }
{ call to:
READSTR
READ_REAL
READ_INT
depending if that value has changed.}
DOW : WORD; { Contains Day-of-Week after a call to
WRITE_DATE }
DYNAMIC_PATHEXEC : BOOLEAN; { For future use only }
NOW : INTEGER; { After each all to WRITE_TIME this
integer contains the number of minutes
since 12:00 midnight }
TEXTATTR_AT_ENTRY : BYTE; { Set to TEXTATTR at entry to program }
{ at exit of program the default colors }
{ are reset to whatever this value is }
UT : UT_TYPE; { Global variables }
X_IN : INTEGER; { Cursor position on entry to READ_STR }
X_OUT : INTEGER; { Cursor position on exit from READ_STR }
GLOBAL : STRING[15] ABSOLUTE $0000:$04F0;
{ This variable acces 16 bytes of memory }
{ that are reserved for programmer use. }
{ This location allows one program to }
{ to communicate with another. }
{ If you set this value in one program }
{ you can later read it in any other }
{ and the original value will be there. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE BEEP;
(* Nicer than CHR(7). *)
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE BIN_LED(L : BYTE);
{ USES KEYBOARD LED'S TO TURN ON A BINARY NUMBER FROM 0 TO 7 }
{ }
{ BIN_LED(5) Used for Debugging, }
{ 0 Turns OFF CAPS, SCROLL, NUM }
{ 1 Turns ON SCROLL, OFF CAPS, NUM }
{ 2 Turns ON NUM, OFF CAPS, SCROLL }
{ BINARY VALUE 3 Turns ON SCROLL, NUM OFF CAPS }
{ CAPS NUM SCROLL 4 Turns ON CAPS, OFF SCROLL, NUM }
{ 5 Turns ON CAPS, SCROLL, OFF NUM }
{ 4 2 1 6 Turns ON CAPS, NUM, OFF SCROLL }
{ 7 Turns ON CAPS, NUM, SCROLL }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION BLANKS(INSTRING : STRING) : BOOLEAN;
{ S : STRING; Returns true of the string passed }
{ is blanks. The Length byte is used }
{ S := ' '; and only that many characters are. }
{ IF S = BLANKS THEN checked. }
{ PROCESS_ROUTINE; }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE BLINK_OFF;
{ If an EGA or VGA card is installed }
{ this call will change the blink }
{ attribute to a high-intensity attr. }
{ This allows you to use hi-intensity }
{ colors for a background color }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE BLINK_ON;
{ If an EGA or VGA card is installed }
{ this call will change the blink }
{ attribute back to normal. See }
{ BLINK_OFF above. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SET_BORDER(COLOR : INTEGER);
{ Sets the border to COLOR. }
(*════════════════════════════════════════════════════════════════════════*)
procedure SetBlink(On : Boolean);
{-Enable text mode attribute blinking if On is True}
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION SetEnv(NAME, VALUE : STRING) : BOOLEAN;
{ Set environment string, returning }
{ true if successful. This routine }
{ sets the Master Environment, not a }
{ copy of it like most. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION CAPS_ARE_ON : BOOLEAN;
{ Returns TRUE if CAPS LOCK is ON. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE CAPS_OFF;
{ Turns CAPS LOCK KEY off. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE CAPS_ON;
{ Turns CAPS LOCK KEY on. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE CENTER(Y, ATTRIB : INTEGER; LINE : STRING);
{ Centers LINE on Line y }
{ using ATTRIB for colors. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE CENTER_PRINT(LINE : STRING;
LEN : INTEGER;
VAR NEXTPOS : INTEGER;
CR : BOOLEAN);
{ Prints LINE on Printer Centered on }
{ a line LEN characters long. }
{ NEXTPOS returns the cursor position }
{ off the print head. Set CR to True }
{ to issue a WRITELN or False to issue}
{ a WRITE. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION CHECK_KEYBOARD : CHAR;
{ If a key was pressed returns the }
{ character entered, else returns }
{ character #0. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE CLEAR_BUFFER(VAR SCREEN : BUFFER;
ATTR : INTEGER);
{ Clears a BUFFER variable to spaces }
{ with the screen attributes ATTR }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION COMBINE(S1, S2 : STRING;
MAX : INTEGER;
INSERT_COMMA : BOOLEAN) : STRING;
{ }
{ S1 := 'Tom '; }
{ S2 := 'Hunter '; }
{ WRITELN(COMBINE(S2,S1,20,TRUE)); }
{ }
{ Result: Combines the two variables S1 & S2 }
{ Hunter, Tom removing trailing blanks from S1. }
{ If passed TRUE it will insert a }
{ comma between the two variables. }
{ Will always return a string MAX }
{ characters in length. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION COMMA(VAR VALUE; FIELDWIDTH,
PLACES : INTEGER;
NTYPE : TYPEN) : STRING;
{ WRITE(COMMA(R,I,J,RNUM)); Will take the real value }
{ R and return a string I }
{ R := 1234567.89 characters long with J }
{ WRITE(COMMA(R,12,2,RNUM)); decimal places. }
{ }
{ Result: }
{ 1,234,567.89 RNUM for REAL Numbers }
{ INUM for INTEGER Numbers }
{ LNUM for LONGINT Numbers }
{ }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION DATE_TIME_KEY : STR16;
{ Returns a string in the form of: }
{ 1990022013211222 YYYYMMDDHHMMSSHH }
{ YEAR,MONTH,DAY,HOUR,MINURES,SECONDS,HUNDREDS }
{ See KEY_TO_DATE Function. }
(*════════════════════════════════════════════════════════════════════════*)
procedure DayWeek(DT : STR8; var DayNum: integer;
var DayName: Str3);
{ }
{ Pass this routine a date in the form }
{ of mm-dd-yy, and it will return the }
{ DAYNUM (sun=0, sat=6) and a string }
{ of 3 for the day name (SUN,MON,ETC) }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE DISP_NOPROMPT_MESSAGE(X,Y,LEN,ATTR : INTEGER; MESS : STR80);
{ Displays a message on screen at X,Y }
{ in the color ATTR. Mess is padded }
{ with spaces to make it LEN in length. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION DUP(MASK : CHAR; N : INTEGER) : STRING;
{ Returns a string N characters long, }
{ with all characters equal to MASK. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION CREATE_NEW_FILE(FILENAME, MESS : STR80) : BOOLEAN;
{ Displays a message on screen that }
{ says FILENAME is not found and program}
{ is being aborted. Informs user to }
{ contact MESS for information. }
{ Pressing ALT-F1 at this message will }
{ return TRUE, any other key returns }
{ FALSE. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE DISP_MESSAGE(X,Y,LEN,ATTR : INTEGER; MESS : STR80);
{ Displays a message on screen at X,Y }
{ in the color ATTR. Mess is padded }
{ with spaces to make it LEN in length. }
{ Program is halted until a key is }
{ pressed. That char is returned in }
{ the global var CH. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE DOWN_SOUND;
{ Makes a Sound of Decreasing Pitch. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION DRIVE_READY(DRIVE : CHAR) : BOOLEAN;
{ IF DRIVE_READY('A') THEN Returns TRUE if drive is ready. }
{ ASSIGN(F,'A:TEST.DTA'); }
{ }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION ELAP_TIME(T : LONGINT) : LONGINT;
{ ELAP_TIME(TIM); Will Return the number of seconds }
{ that have elapsed since the last }
{ call to START_TIMER with TIM, or }
{ any other LONGINT variable. }
{ See START_TIMER. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION ELAP_TIME_STR(TIM : LONGINT) : STRING;
{ ELAP_TIME_STR(TIM); Will Return the amount of time }
{ that have elapsed since the last }
{ call to START_TIMER with TIM, or }
{ any other LONGINT variable. }
{ The returned string will be in the}
{ form of:
{ 2 days, 11 hrs, 12 mins, 21 sec }
{ }
{ Leading numbers will not be shown }
{ if they are zero. }
{ }
{ If a timer is left running for }
{ 25 years, the longest string that }
{ would be returned would be 35 }
{ characters in length. }
{ (Always PADDED to 35 chars.) }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE ENCRYPT(VAR LINE : STRING; I : INTEGER);
{ Encrypts a string using I as a key. }
{ See UN_ENCRYPT }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION FILE_EXIST(FILENAME : STRING) : BOOLEAN;
(* Returns True if File exists or
false if it does not. *)
(* Can be used on any type File. *)
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION FILE_OPEN(VAR F) : BOOLEAN;
(* Returns True if File F is Open or
returns False if it is closed. *)
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE FILL_SCREEN(X1,Y1,X2,Y2 : INTEGER; CH : CHAR; ATTR : INTEGER);
{ FILL_SCREEN(1,1,80,25,'░',$1F); Fills the section of the screen }
{ definded by X1, Y1, X2, X2 with }
{ character CH, in the text attribute }
{ of ATTR. }
{ $1F = Color 1 for Background Color }
{ and color F (15) for foreground }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE FW(X,Y : INTEGER; ATTR : BYTE; LINE : STR80);
{ FW(X,Y,$07,S); Writes the value of string }
{ or S at X,Y with 0 Background }
{ FW(X,Y,$01,S1+S2+'X'); color and 7 Foreground. }
{ This Procedure Supports }
{ 43 line mode. (1 >= Y <= 43 }
{ $07 = Color 0 for Background Color }
{ and color 7 for foreground }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE FWB(VAR SCREEN : BUFFER;
X,Y,ATTR : INTEGER;
INSTRING : STR80);
{ Same as FW procedure except it writes}
{ INSTRING to a BUFFER variable. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION GET_FILE_INFO(FILENAME : STRING) : STR80;
{ INSTRING := GET_FILE_INFO('C:\AUTOEXEC.BAT'); }
{ Returns a string containing }
{ file size, date, and time. }
{ }
{ " 345 6/04/90 12:44p" }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION GET_FILE_NAME(MASK : STRING; DEL : BOOLEAN) : STRING;
{ INSTRING := GET_FILE_NAME('*.*',TRUE);
{ Pops up a window displaying }
{ filenames matching filespec. }
{ Returns a selected filename }
{ and allows deletions if TRUE. }
{ If <ESC> is pressed, will return a }
{ null string }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE GOTOXY43(X,Y : INTEGER);
{ GOTOXY43(10,43); This will move the cursor to }
{ 10,43 if 43 line mode is active }
{ Even in 25 line mode this will }
{ work if y is <= 25 }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION INT_STR(I,LEN : INTEGER) : STR80;
{ INT_STR(2300,6); This will return a string }
{ " 2300" }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION JULIAN(DT : STR8) : LONGINT;
{ JULIAN(DATE) Returns a LONGINT value that }
{ can be used to calculate the }
{ difference between two dates. }
{ DT must be in the form mm-dd-yy }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION JulToMDY(JulianDay: longint) : STR8;
{ JULTOMDY(LONG) Returns a DATE in the form of }
{ mm-dd-yy. See JULIAN. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION KEY_TO_DATE(ST : STRING) : STRING;
{ Converts a DATE_TIME_KEY back }
{ to a valid date and time. }
{ See DATE_TIME_KEY Function. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE LINES25;
{ After a call to LINES43, this }
{ will return you to 25 line mode.}
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE LINES43;
{ If EGA card is present this }
{ will put you in 43 line mode. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION LONGINT_STR(I : LONGINT; LEN : INTEGER) : STR80;
{ LONGINT_STR(230000,10); This will return a string }
{ " 230000" }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION NUM_LOCK_IS_ON : BOOLEAN;
{ Returns TRUE if NUM-LOCK is ON. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE NUM_LOCK_OFF;
{ Turns NUM LOCK KEY off. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE NUM_LOCK_ON;
{ Turns NUM LOCK KEY on. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION PAD(S : STRING; LEN : INTEGER) : STRING;
{ PAD(S,20); Will return S + spaces exactly 20 }
{ characters long. Padded with spaces }
{ at the end of S. }
(*════════════════════════════════════════════════════════════════════════*)
Function PackKey(Dte, Tme : str8) : longint;
{ See UnPackKey. }
{ var L : longint; Set Parms to '' to }
{ return key for current }
{ L := PackKey('10-11-91','12:14:22'); date & time. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION PAD_LEFT(S : STRING; LEN : INTEGER) : STRING;
{ PAD_LEFT(S,20); Will return S + spaces exactly 20 }
{ characters long. Padded with spaces }
{ at the beginning of S. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION PAD_CH(S : STRING; LEN : INTEGER; CH : CHAR) : STRING;
{ PAD_CH(S,20,'A'); Will return S + CH's exactly 20 }
{ characters long. S will be padded }
{ with 'A's until it is 20 characters }
{ in length. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE PATHEXEC(COMMAND : PATHSTR; PARMS : STRING);
{ Future use only }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE POP_WINDOW(X1,Y1,X2,Y2 : INTEGER; STYLE : INTEGER; ATTR : BYTE);
{ Pops up a Window. The window size }
{ is determined by X1,Y1,X2,Y2. }
{ These parameters work exactly as }
{ the window command in Turbo Pascal. }
{ }
{ If STYLE is set to 0, there will be }
{ no border around the window. If it }
{ is set to 1 there will be a single }
{ line border. If it is set to 2 }
{ the border will be a double line. }
{ 0,1,2 will place a shadow at bottom }
{ and right side. }
{ }
{ If STYLE is set to 10, there will be }
{ no border around the window. If it }
{ is set to 11 there will be a single }
{ line border. If it is set to 12 }
{ the border will be a double line. }
{ 10,11,12 will not place a shadow. }
{ }
{ ATTR is the color attribute of the }
{ window. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE POP_MESSAGE( X,Y : INTEGER;
BORDER, ATTR : BYTE;
MATTR : BYTE;
MESSAGE : STR80);
{ Pops a window at X,Y around MESSAGE }
{ If X is set to 0, the window is }
{ centered on the screen horizontally }
{ X,Y = Upper Left Corner of window }
{ BORDER = (See POP_WINDOW) }
{ ATTR = Color of border }
{ MATTR = Color of MESSAGE }
{ MESSAGE = Message to be displayed }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE POP_WINDOW_TITLE( X,Y,X1,Y1 : INTEGER;
BORDER, ATTR : BYTE;
TATTR,
TY : BYTE;
TITLE : STR80);
{ Pops a window (X,Y,X1,Y1) same as }
{ POP_WINDOW. TITLE will be centered }
{ based on the window width, on line }
{ TY in the color of TATTR. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE PRINT_SCREEN(X1,Y1,X2,Y2 : INTEGER; EXT : BOOLEAN);
{ }
{ PRINT_SCREEN(1,1,80,25,TRUE); Prints a section of the screen, }
{ bounded by the coordinates. The }
{ screen coordinates are the same as }
{ Turbo Pascal's WINDOW procedure. }
{ To print IBM Extended Graphic }
{ characters use TRUE. FALSE will }
{ print spaces instead of graphics. }
{ The above example would print the }
{ entire screen. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION PRINTER_NOT_READY : BOOLEAN;
{ Returns TRUE if the Line Printer is not ready. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION PRINTER_READY : BOOLEAN;
{ }
{ IF PRINTER_READY THEN If Printer is NOT READY, pops up }
{ WRITELN(LST,'HELLO WORLD'); a Window, asking for you to ready }
{ it. Pressing <ESC> returns FALSE. }
{ Turning Print ON, (or if it was }
{ already on) returns TRUE. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION PROGRAM_LOCATION : STRING;
{ }
{ Returns a string containing the }
{ drive and complete pathname of }
{ where the currenly executing program }
{ is located. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION RANDOM_NUMBER(LOW, HIGH : INTEGER) : INTEGER;
(* Produces a Random number between
0 and 99. if LOW is less than 0
or HIGH is greater than 99 will
always return 0. Do not call this
routine from a loop. It uses 1/100
of a second from the system clock
to generate the numbers. If called
from within a loop it will return
a sequence or pattern to its numbers.
Works fine for a ocassional Random
Number. *)
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READCH(VAR CH : CHAR; ECHO : BOOLEAN);
{ READCH(CH,TRUE); TRUE for echo on screen. }
{ FALSE for no echo. }
{ If ALT-F10 is pressed it }
{ will call SHOW_VERSION. }
{ If the global var ut.timex }
{ is set to other than 0, the }
{ time is continually updated }
{ on the screen at ut.timex, }
{ ut.timey until a key is pressed }
{ }
{ also converts F-KEYS to FUNC1..FUNC10, HOMEKEY, }
{ UP, DOWN, LEFT, RIGHT, ECT. }
{ }
{ READCH(CH,TRUE); }
{ IF CH = FUNC1 THEN CALL_HELP; }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READCHT(VAR CH : CHAR; ECHO : BOOLEAN; TOO : LONGINT);
{ Waits TOO seconds for a key to be pressed, IF no key is pressed }
{ within TOO seconds, Routine is exited leaving CH unchanged. }
{ }
{ READCHT(CH,FALSE,10); Waits 10 seconds for a key to be }
{ pressed, If not CH is unchanged. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READCHTIME(VAR CH : CHAR; ECHO : BOOLEAN; X,Y : INTEGER);
{ This routine is for backward }
{ compatibility only. Use READCH }
{ instead. By setting the global }
{ vars UT.TIMEX and UT.TIMEY the }
{ time is kept automatically using }
{ READCH }
{ }
{ Continually Updates TIME at X,Y }
{ until a key is pressed. That }
{ key is returned in CH. }
{ If CH = 'M' Time will be in }
{ Military Time Format. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_DIGIT( X,Y : INTEGER;
VAR VALUE;
RIGHT_JUST : INTEGER;
LOW, HIGH : LONGINT;
NTYPE : TYPEN);
{ Reads a INT OR A LONGINT value from }
{ input. }
{ This procedure should be used when }
{ calculator style input is desired. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_MONEY(X,Y : INTEGER;
VAR R : REAL;
DPLACES : INTEGER;
RIGHT_JUST : INTEGER;
LOW, HIGH : REAL);
{ Reads a Real value from input. }
{ This procedure should be used when }
{ calculator style input is desired. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_R( X,Y : INTEGER;
VAR R : REAL;
MIN,
MAX : REAL;
PLACES : INTEGER;
RIGHT_JUST : INTEGER;
ICOMMA : BOOLEAN);
{ Reads a Real value from input. }
{ This procedure should be used instead}
{ of the old READ_REAL. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_I( X,Y : INTEGER;
VAR R : INTEGER;
MIN,
MAX : INTEGER;
RIGHT_JUST : INTEGER;
ICOMMA : BOOLEAN);
{ Reads a Integer value from input. }
{ This procedure should be used instead }
{ of the old READ_INT. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_L( X,Y : INTEGER;
VAR R : LONGINT;
MIN,
MAX : LONGINT;
RIGHT_JUST : LONGINT;
ICOMMA : BOOLEAN);
{ Reads a LongInt value from intput. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_INT(X,Y,LEN : INTEGER;
PATTR : INTEGER;
PROMPT : STR80;
IATTR : INTEGER;
VAR R : INTEGER;
LOW,HIGH : INTEGER;
EXITCH : ETYPE;
ICOMA : BOOLEAN;
TX, TY : INTEGER;
CH : CHAR);
(*
This procedure is provided only for backward compatibility. Use the
new procedure READ_I for keyboard in put of integer type variables.
WHERE X = X Location of where Prompt will start.
Y = Y Location of where Prompt will start.
LEN = Maximum Length of Field to be input.
PATTR = Color attributes of Prompt.
PROMPT = Prompt that will appear AT X,Y
IATTR = Color attributes of Input Field.
R = Variable Parameter being Edited.
LOW = Lowest Value Allowed.
HIGH = Highest Value Allowed.
EXITCH = Characters Entered From Keyboard used to Exit Edit.
ICOMA = True for comma insertion, false for no comma.
TX,
TY = Location on screen to update time (TX = 0 for
no time)
CH = 'M' for Military Time, else AM/PM
If NOCONV is included in EXITCH then
LEFT or RIGHT is not converted to
UP or DOWN if in first or last
position.
If CLEAR is included in EXITCH then
the value being edited is set to
spaces.
Insert keys & Delete keys are active
*)
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_ONLY(NAME : STRING);
{ Sets Filename "NAME" to READ-ONLY.}
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_REAL(X,Y,LEN : INTEGER;
PATTR : INTEGER;
PROMPT : STR80;
IATTR : INTEGER;
VAR R : REAL;
DPLACES : INTEGER;
LOW,HIGH : REAL;
EXITCH : ETYPE;
ICOMA : BOOLEAN;
TX, TY : INTEGER;
CH : CHAR);
(*
This procedure is provided only for backward compatibility. Use the
new procedure READ_R for keyboard in put of real type variables.
WHERE X = X Location of where Prompt will start.
Y = Y Location of where Prompt will start.
LEN = Length of Field to be Input.
PATTR = Color Attributes of Prompt.
PROMPT = Prompt that will appear at X,Y
IATTR = Color Attributes of Input Field.
R = Variable Parameter being Edited.
DPLACES = Number of Decimal Places.
LOW = Lowest Value Allowed.
HIGH = Highest Value Allowed.
EXITCH = Characters Entered From Keyboard Used to Exit Edit.
ICOMA = True for Comma Insertion, False for no commas.
TX,
TY = Location on Screen to Update Time (TX = 0 for
no Time.)
CH = 'M' for Military Time, else AM/PM
If NOCONV is included in EXITCH then
LEFT or RIGHT is not converted to
UP or DOWN if in first or last
position.
If CLEAR is included in EXITCH then
the value being edited is set to
spaces.
Insert keys & Delete keys are active
*)
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION READ_SCREEN(X,Y : INTEGER) : CHAR;
{ CH := READ_SCREEN(10,15); }
{ Returns the character on the screen }
{ at X,Y. (at 10,15 in this case) }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READSTR(X,Y,LEN : INTEGER;
PATTR : INTEGER;
PROMPT : STR80;
IATTR : INTEGER;
VAR INSTRING : STR80;
VALID : ETYPE;
CANEDIT : CTYPE;
EXITCH : ETYPE;
XLOC,
YLOC : INTEGER;
CH1 : CHAR);
(*
WHERE X = X Location of Where Prompt will start.
Y = Y Location of Where Prompt will start.
LEN = Maximum Length of Input Field.
PATTR = Color Attributes of Prompt.
PROMPT = Prompt that will appear at X,Y.
IATTR = Color Attributes of Input Field.
INSTRING = Variable Parameter being Edited.
VALID = Valid Characters that can be entered for Field.
CANEDIT = Which Positions of Field that can be edited.
EXITCH = Characters Entered from Keyboard Used to Exit Edit.
XLOC,
YLOC = Location on screen to Update Time (XLOC = 0 for
no time.) Add 100 to XLOC to initialize the
cursor at the end of the input field instead of at
the beginning.
(Add 100 to YLOC for Auto Capitilization of Words)
(Add 200 to YLOC for Auto Caps of all characters )
CH1 = 'M' for Military Time, else AM/PM
If you are in the first position of a field and press the RIGHT
ARROW, CH is converted to UP. If you are in the last position of
a field and press RIGHT ARROW, CH is converted to DOWN.
UNLESS: If you include NOCONV in your EXITCH, conversion does
not take place. If you are in the first postion of a field,
pressing LEFT ARROW will cause you to exit and leave the value
of CH set to LEFT. If you are in the last position of a field
pressing RIGHT ARROW will cause you to exit and leave the value
CH set to RIGHT.
If CLEAR is included in EXITCH then the value being edited is
set to spaces.
Insert keys & Delete keys are active.
*)
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_STR(X,Y : INTEGER;
VAR INSTRING : STR80;
MASK : STR80);
(*
WHERE X = X Location of Where Prompt will start.
Y = Y Location of Where Prompt will start.
INSTRING = Variable Parameter being Edited.
MASK = Input mask:
' ' Allows any keyboard input at this location.
'c' Same as ' ' except turns on Auto Word Capitalization
for entire string.
'y' Either a 'Y' or an 'N' is allowed in this position.
If lower case is entered it is automatically converted
to uppercase.
'A' Any character is allowed. Alpha at this location is
converted to uppercase.
'0' Numeric. Characters 0 thru 9 only are allowed.
'1' Numeric. Characters 0 thru 9 and ' ' are allowed.
'.' Numeric. Characters 0 thru 9 and '.' are allowed.
'!' Numeric. Characters 0 thru 9 and ' ' and '.' are allowed.
'+' Numeric. Characters 0 thru 9 and ' ' and '.' and '+'
and '-' are allowed.
'x' Restricts this position from being edited. The cursor
will skip this field.
'Any other character in the mask' will be inserted into the
input string.
Examples:
read_str(30,12,name,'(111)x000-0000');
will initialize positions 1,5 and 10 to : '( ) - ';
will allow spaces or digits for area code.
will allow only digits for number.
*)
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READSTR_BIG(X,Y,LEN : INTEGER;
PATTR : INTEGER;
PROMPT : STR80;
IATTR : INTEGER;
VAR INSTRING : STRING;
VALID : ETYPE;
CANEDIT : CTYPE;
EXITCH : ETYPE;
XLOC,
YLOC : INTEGER;
CH1 : CHAR;
WIN : INTEGER);
(* Scrolling string Input. *)
(* All parameters are the same as *)
(* READSTR except the addition of WIN.*)
(* WIN is the size of the input field *)
(* for this input, LEN is the total *)
(* possible length of INSTRING. *)
(* *)
(* *** CANEDIT is set automaticall *)
(* to all positions **** *)
(* *)
(* Insert keys & Delete keys are *)
(* active. *)
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE READ_WRITE(NAME : STRING);
{ Sets Filename "NAME" to READ-WRITE.}
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION REAL_STR(R : REAL; LEN, PLACES : INTEGER) : STR80;
{ REAL_STR(123.22,10,2); This would return a string }
{ " 123.22" }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE REBOOT;
{ Performs a re-boot of the computer }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE REBUILD_LINE(Y : INTEGER; STR : BUF160);
{ DEFINE A VARIABLE: }
{ VAR }
{ S : BUF160; }
{ }
{ SAVE_LINE(5,S); Saves Line 5 in S. }
{ REBUILD_LINE(5,S); Restores Line 5 from S. }
{ }
{ This routine saves screen characters and attributes }
{ }
{ CAUTION ! IN 43 LINE MODE, USE ONLY FOR FIRST 25 LINES }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE REBUILD_SCREEN(VAR SCREEN : BUFFER);
{ SEE SAVE_SCREEN }
{ }
{ CAUTION ! In 43 Line Mode, Will only Restore top 25 lines.}
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SAVE_LINE(Y : INTEGER; VAR STR : BUF160);
{ DEFINE A VARIABLE: }
{ VAR }
{ S : BUF160; }
{ }
{ SAVE_LINE(5,S); Saves Line 5 in S. }
{ REBUILD_LINE(5,S); Restores Line 5 from S. }
{ }
{ This routine saves screen characters and attributes }
{ }
{ CAUTION ! IN 43 LINE MODE, USE ONLY FOR FIRST 25 LINES }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SAVE_SCREEN(VAR SCREEN : BUFFER);
{ DEFINE A VARIABLE: }
{ VAR }
{ S : BUFFER; }
{ }
{ SAVE_SCREEN(S); Saves Current Screen in S. }
{ REBUILD_SCREEN(S); Restores Screen to S. }
{ }
{ CAUTION ! IN 43 LINE MODE, WILL ONLY SAVE TOP 25 LINES }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION SCREEN_ATTR(X,Y : INTEGER) : BYTE;
{ TEXTATTR := SCREEN_ATTR(10,20); }
{ Returns the Screen Color at X,Y. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SET_ATTR(X : LINE_SET; Y : INTEGER;ATTRIB : BYTE);
{ SET_ATTR([1..4,10],Y,$07); }
{ Sets the Columns 1 thru 4 and 10 on line Y }
{ to Background Color 0 (BLACK) }
{ and Foreground COLOR 7 (LIGHTGRAY) }
{ CAUTION ! Use this only above line 26 if in 43 line mode. }
{ Leaves text on screen unchanged }
{ $07 = Color 0 for Background Color }
{ and color 7 for foreground }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SCREEN_ON;
{ Turns the Screen back on after }
{ it has been turned off with }
{ SCREEN_OFF }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SCREEN_OFF;
{ Turns the Screen off to a black }
{ screen. Use SCREEN_ON to turn }
{ it back on . }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SCROLL_LOCK_ON;
{ }
{ Turns the Scroll Lock key on. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SCROLL_LOCK_OFF;
{ }
{ Turns the Scroll Lock key off. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION SCROLL_LOCK_IS_ON : BOOLEAN;
{ }
{ Returns TRUE if the Scroll Lock Key is on else returns FALSE. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SET_ATTR_BUFFER(VAR SC : BUFFER;
X : LINE_SET;
Y : INTEGER;
ATTRIB : BYTE);
{ SET_ATTR_BUFFER(SC,[1..4,10],Y,$07); }
{ This routine alters the attributes of a BUFFER }
{ screen, not the active video screen. }
{ Sets the Columns 1 thru 4 and 10 on line Y }
{ to Background Color 0 (BLACK) }
{ and Foreground COLOR 7 (LIGHTGRAY) }
{ CAUTION ! Use this only above line 26 if in 43 line mode. }
{ Leaves text on screen unchanged }
{ $07 = Color 0 for Background Color }
{ and color 7 for foreground }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SET_ATTR_BOX(X1,Y1,X2,Y2,ATT : INTEGER);
(* Sets Screen Attributes of the box
X1,Y1,X2,Y2 to the Colors of ATT.
Coordinates are the same as Turbo
Pascals Window Procedure. *)
{ Leaves text on screen unchanged }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SET_CURSOR(CURS : CURTYPE);
{ SET_CURSOR(NONE); Makes Cursor Invisable. }
{ SET_CURSOR(UNDERLINE); Makes Normal Cursor. }
{ SET_CURSOR(BLOCK); Makes Block Cursor. }
{ SET_CURSOR(HALF); Makes a Half Cursor. }
{ Cursor is returned to }
{ normal on exit of program, }
{ unless RESET_CURSOR is set }
{ to FALSE }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION SHIFT_KEYS(KEY : CHAR) : BOOLEAN;
{ KEY = 'R' for Right, 'L' for Left, 'C' for Control, 'A' for Alt }
{ Returns true if key is pressed }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE SHOW_VERSION;
{ Displays a Window and the contents of the }
{ global variable VERSION. }
{ Also displays the version of UTILITY your program }
{ was compiled with. }
{ From any of UTILITY read procedures pressing }
{ ALT-F10 will call this routine }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION SPACES(NUM : Word) : STRING;
{ S := SPACES(25); Will Initialize the variable S }
{ to 25 spaces. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION STRIP(ST : STRING; IMBED : BOOLEAN) : STRING;
{ Removes Leading and Trailing }
{ spaces from a string variable. }
{ If IMBED is set to true it will }
{ also removes all but 1 blank }
{ between words. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE START_TIMER(VAR T : LONGINT);
{ START_TIMER(TIM); Will Start a timer by setting the }
{ value of TIM (or any LONGINT) to }
{ a time related value. }
{ By calling ELAP_TIME with this }
{ same variable, you can tell how }
{ many seconds has elapsed. }
{ This routine works accurately }
{ for over 30 years. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE StuffBuffer(S : STR16);
{ StuffBuffer('DIR'); Will Stuff S into the keyboard }
{ buffer, just as if it were }
{ entered from the keyboard. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE UN_ENCRYPT(VAR LINE : STRING; I : INTEGER);
{ UN-ENCRYPTS A STRING USING I AS KEY.}
{ See ENCRYPT. }
(*════════════════════════════════════════════════════════════════════════*)
Function UnPackKey(PK : longint) : str20;
{ See PackKey }
{ Returns a string equal }
{ write(UnPackKey(L)); ==> 10-10-91 12:14:22 to the Date & Time }
{ Packed into L. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION UPPERCASE(S : STRING) : STRING;
{ S := UPPERCASE(S); Will Uppercase all Lowercase }
{ characters in the string S. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE UP_SOUND;
{ Makes a Sound of Increasing Pitch. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION VGA_INSTALLED : BOOLEAN;
{ Returns TRUE if a VGA card is present }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION WHOAMI : STRING;
{ S := WHOAMI; Returns the complete Drive & }
{ Pathname & Filename of the }
{ C:\TEST\FILENAME.EXE program being executed. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE WRITE_DATE(X, Y : INTEGER; WORDS : CHAR);
{ WRITE_DATE(X,Y,'W'); Will display the current }
{ date in words at screen }
{ location X,Y. }
{ If words = 'W' March 2, 1988 }
{ If words = 'D' Monday April 8, 1991 }
{ else 03/02/88 }
{ Any character except W or D }
{ will display it in }
{ 03/02/88 format. }
{ }
{ Also update the Global }
{ variable DATE to the }
{ current date. If X=0 }
{ DATE is updated without }
{ anything being written }
{ to the screen. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE WRITE_TIME(X, Y : INTEGER; MILITARY : CHAR);
{ WRITE_TIME(X,Y,'M'); Will display the current }
{ time in Military Format }
{ 14:52 at screen location X,Y. }
{ 2:52 pm }
{ Any Character Except M }
{ will display time in AM/PM.}
{ The Colon Will Blink. }
{ }
{ Also update the Global }
{ variable TIME to the }
{ current time. If X=0 }
{ TIME is updated without }
{ anything being written }
{ to the screen. }
(*════════════════════════════════════════════════════════════════════════*)
PROCEDURE WRITE_X80_Y25(CH : CHAR; ATTRIB : INTEGER);
(* Writes CH at Column 80 on Line 25
in the Colors of ATTRIB without
scrolling. *)
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION _REAL(INSTRING : STRING) : REAL;
{ Returns a REAL value from string. }
{ Spaces in string are ignored. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION _INTEGER(INSTRING : STRING) : INTEGER;
{ Returns an INTEGER value from string.}
{ Spaces in string are ignored. }
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION _LONGINT(INSTRING : STRING) : LONGINT;
{ Returns a LONGINT from a string. }
{ Spaces in string are ignored. }
(*════════════════════════════════════════════════════════════════════════*)
(*════════════════════════════════════════════════════════════════════════*)
FUNCTION _WORD(INSTRING : STRING) : WORD;
{ Returns a WORD from a string. }
{ Spaces in string are ignored. }
(*════════════════════════════════════════════════════════════════════════*)