
                CopyRight (c) 1989,1990    Steven Lutrov
                       Paracom Software Resources


This Toolkit is a collection of Procedures and Functions written in Assembler
Language to give the Pascal Compiler optimum performance in relation to speed.
The Pascal it was tested with is Borlands Turbo Pascal 5.5.

I do not expect any royalty fees but the TPU file cannot be sold on its own.


Any questions can be put to me in writing or messages on Victorian BBS Systems.



                    Paracom Software Resources.
                    PO Box 466
                    Essendon, VIC 3040
                    Australia


         Steven Lutrov is a member of The Melbourne PC User Group Inc.
























{------------------------------------------------------------------------------}
AltKeyDown                                                              Kbd88_21


Description  :    Report if <Alt> Key is Pressed

Declerations :    Function Altkeydown: Boolean;


Parameters   :    None

{------------------------------------------------------------------------------}
BackGround                                                              Scr88_21


Description  :    Set up the Background Colour Attribute.

Declerations :    Procedure Background(Code: Char);


Parameters   :    Code          Character Code from Table in Remarks.


Remarks      :    k     Black           K       Light  Black (Grey)
                  b     Blue            B       Light  Blue
                  g     Green           G       Light  Green
                  c     Cyan            C       Light  Cyan
                  r     Red             R       Light  Red
                  m     Magenta         M       Light  Magenta
                  y     Yellow          Y       Bright Yellow
                  w     White           W       Bright White


Also Note That Monochrome attributes are possible  e.g.


     Attribute                       ForeGround      BackGround
     =========                       ==========      ==========

     Normal                              w               k
     Intense                             W               k
     Underlined                          b               k
     Underlined & Intense                B               k
     Reverse                             k               w
     Blinking                            w               K
     Blinking & Intense                  W               K
     Blinking & Underlined               b               K
     Blinking & Intense & Inderlined     B               K
     Blinking & Reverse                  k               W
       

See Also ForeGround

{------------------------------------------------------------------------------}
Blinkoff                                                                Scr88_21


Description  :    Set Text Attribute To Not Blink.

Declerations :    Procedure BlikOff;


Parameters   :    None

{------------------------------------------------------------------------------}
Blinkon                                                                 Scr88_21


Description  :    Set Text Attribute To Blink;

Declerations :    Procedure BlinkOn;



Parameters   :    None

{------------------------------------------------------------------------------}
Bytetohex                                                               Bit88_21


Description  :    Convert a Byte Variable To Hex.

Declerations :    Function ByteToHex (Work_ : Byte) :Stype;


Parameters   :    Work_         The Byte that is converted


{------------------------------------------------------------------------------}
CapsLockDown                                                            Kbd88_21


Description  :    Report if <Caps Lock> Key is Pressed

Declerations :    Function CapsLockdown: Boolean;


Parameters   :    None


{------------------------------------------------------------------------------}
CapsLockOn                                                              Kbd88_21


Description  :    Report if <Caps Lock> Key is Currently On

Declerations :    Function CapsLockdOn: Boolean;


Parameters   :    None


{------------------------------------------------------------------------------}
ClearBuffer                                                             Kbd88_21


Description  :    Clears The Keyboard Buffer.

Declerations :    Procedure Clearbuffer;


Parameters   :    None


{------------------------------------------------------------------------------}
ClearPage                                                               Grp88_21


Description  :    Clears a previously Saved Page from memory.

Declerations :    Procedure Clearpage(Pagenumber,Colour: Byte);


Parameters   :    PageNumber    The Page Number
                  Colour        The Colour Attribute to which the page is
                                cleared.

Notes        :    See GetPage.

{------------------------------------------------------------------------------}
ClearCapslock                                                           Kbd88_21


Description  :    Turn Off The <Caps Lock> Key.

Declerations :    Procedure Clearcapslock;


Parameters   :    None

{------------------------------------------------------------------------------}
ClearIns                                                                Kbd88_21


Description  :    Turn Off The <Ins> Key.

Declerations :    Procedure Clearins;


Parameters   :    None

{------------------------------------------------------------------------------}
ClearNumLock                                                            Kbd88_21


Description  :    Turn Off The <Num Lock> Key.

Declerations :    Procedure ClearNumLock;


Parameters   :    None

{------------------------------------------------------------------------------}
ClearScrollLock                                                         Kbd88_21


Description  :    Turn Off The <Scroll Lock> Key.

Declerations :    Procedure ClearScrollLock;


Parameters   :    None

{------------------------------------------------------------------------------}
CloseFile                                                               Fil88_21

Description  :    Closes a File

Declerations :    Function CloseFile(Handle:Integer):Boolean;


Parameters   :    Handle        The Dos Handle Returned when the file was
                                created. (See CreateFile)


Remarks      :    CloseFile Returns a Boolean Value as follows
                                True  : File Closed Ok
                                False : File Didn't Close Ok


{------------------------------------------------------------------------------}
ChangeChar                                                              Str88_21


Description  :    Changes every instance of a character in a string.

Declerations :    Procedure ChangeChar(Var Strx: Stype; Search,Replace: Char);



Parameters   :    Strx          The String to be manipulated
                  Search        Character that is searched
                  Replace       Character that replaces Search

ErrReturn    :                  0 - Ok
                                1 - Character not Found

Remarks      :    None

{------------------------------------------------------------------------------}
Colourx                                                                 Scr88_21



Description  :    Change The Attribute of a Column of Text.

Declerations :    Procedure Colourx(X_Pos,Y_Pos,Y_Num,Colour: Byte);



Parameters   :    X_Pos         Column Position Coordinate
                  Y_Pos         Row Position Coordinate
                  Y_Num         Number of Columns Deep affecting Attribute
                  Colour        The Attribute (0-255)


Remarks      :    The Text inside the area is left un altered.


{------------------------------------------------------------------------------}
Compare                                                                 Str88_21


Description  :    Compares two Strings

Declerations :    Function Compare(Strx1,Strx2: Stype): Boolean;


Parameters   :    Strx1         First Compare String
                  Strx2         Second Compare String


Remarks      :    Returns TRUE or FALSE if compare was successfull.
                  The case of the characters is ignored.

{------------------------------------------------------------------------------}
CopyClear                                                               Grp88_21


Description  :    Copy the Contents of a Screen Area into a Byte Array
                  and Then clear the Area.

Declerations :    Procedure CopyClear (Box: Pointer;
                                     X_Pos,Y_pos,X_Num,Y_Num,Colour: Byte);


Parameters   :    Box           Byte Array Pointer that holds Screen Contents
                  X_Pos         The Top left Column position
                  Y_pos         The Top left Row Position
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen
                  Colour        The Colour Attribute of the Area.

{------------------------------------------------------------------------------}
CreateFile                                                              Fil88_21

Description  :    Create a File with Specified Attributes

Declerations :    Function CreateFile(Fname:String; Attribute:Integer):Integer;


Parameters   :    Fname         The Name of the File to be Created
                  Attribute     The Attribute of the File to be Created
                                0 = Read Only
                                1 = Hidden
                                2 = System File
                                3 = Volume Label Entry
                                4 = Subdirectory
                                5 = Archive File

Remarks      :    CreateFile Return an Integer Value specifing the following
                  instances. If Greater or equal to 0 the the integer value
                  will designate the handle of the Created file. This is
                  needed to close the file with CloseFile.

                             >= 0 : Ok (Returns Handle)
                               -3 : Path Not Found
                               -4 : Too Many Open Files
                               -5 : Access Denied


{------------------------------------------------------------------------------}
CtrlKeyDown                                                             Kbd88_21


Description  :    Report if <Ctrl> Key is Pressed

Declerations :    Function CtrlKeydown: Boolean;


Parameters   :    None

{------------------------------------------------------------------------------}
Cursordown                                                              Scr88_21


Description  :    Move Cursor Down

Declerations :    Procedure Cursordown(Rows: Integer);



Parameters   :    Rows          Number of Rows to move down.

{------------------------------------------------------------------------------}
Cursorleft                                                              Scr88_21


Description  :    Move Cursor Left

Declerations :    Procedure Cursorleft(Columns: Integer);



Parameters   :    Columns       Number of Columns to move Left.

{------------------------------------------------------------------------------}
Cursoroff                                                               Scr88_21


Description  :    Turn Cursor Off

Declerations :    Procedure CursorOff;



Parameters   :    None

{------------------------------------------------------------------------------}
Cursoron                                                                Scr88_21


Description  :    Turn Cursor On

Declerations :    Procedure CursorOn;



Parameters   :    None

{------------------------------------------------------------------------------}
Cursorright                                                             Scr88_21


Description  :    Move Cursor Right

Declerations :    Procedure Cursorright(Columns: Integer);



Parameters   :    Columns       Number of Columns to move Right.

{------------------------------------------------------------------------------}
Cursorup                                                                Scr88_21


Description  :    Move Cursor Up

Declerations :    Procedure Cursorup(Rows: Integer);



Parameters   :    Rows          Number of Rows to move up.

{------------------------------------------------------------------------------}
Deletechar                                                              Str88_21


Description  :    Deletes all occurances of a specified character.

Declerations :    Procedure Deletechar(Var Strx: Stype; Ch: Char);


Parameters   :    Strx          The String to be manipulated.
                  Ch            The Character to be deleted.

ErrReturn    :                  0 - Ok
                                1 - Character not Found


{------------------------------------------------------------------------------}
Deleteleft                                                              Str88_21


Description  :    Deletes all characters from the begining of a string
                  until a specified character is reached.

Declerations :    Procedure Deleteleft(Var Strx: Stype; Border: Char);


Parameters   :    Strx          The String to be manipulated.
                  Border        The Character at which deletion stops

ErrReturn    :                  0 - Ok
                                1 - Character not Found


{------------------------------------------------------------------------------}
DrawBox                                                                 Grp88_21


Description  :    Draws a Simple Box on the Screen.

Declerations :    Procedure Drawbox (Char_X ,Char_Y :Char;
                                     X_Pos,Y_pos,X_Num,Y_Num,Colour:Byte);


Parameters   :    Char_X        The Character used for Horizontal Lines
                  Char_Y        The Character used for Vertical Lines
                  X_Pos         The Top left Column position
                  Y_pos         The Top left Row Position
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen
                  Colour        The Colour Attribute of the Characters.


{------------------------------------------------------------------------------}
Deleteright                                                             Str88_21


Description  :    Deletes all characters from the end of a string
                  until a specified character is reached.

Declerations :    Procedure Deleteright(Var Strx: Stype; Border: Char);


Parameters   :    Strx          The String to be manipulated.
                  Border        The Character at which deletion stops

ErrReturn    :                  0 - Ok
                                1 - Character not Found


{------------------------------------------------------------------------------}
Dsp                                                                     Scr88_21

Description  :    Write and Memory-map Strings to the screen.

Declerations :    Procedure Dsp(Strx: Stype);



Parameters   :    Strx          The String to write

Remarks      :    The String can be written to any page.
                  The Colour Attribute of the string is set to
                  the global variable TEXTATTR.
                  No CR+LF is sent (see Dspln).


{------------------------------------------------------------------------------}
DspAt                                                                   Scr88_21


Description  :    Writes Strings on the screen

Declerations :    Procedure DspAt(Strx: Stype; X_Pos,Y_Pos,Colour: Byte);


Parameters   :    Strx          The String to Write
                  X_Pos         The Column Location Position
                  Y_Pos         The Row Location Position
                  Colour        The Colour Attribute of the String (0-255)


{------------------------------------------------------------------------------}
DspColour                                                               Scr88_21


Description  :    Write and Memory-map Strings to the screen.

Declerations :    Procedure DspColour(Strx: Stype; Colour: Byte);



Parameters   :    Strx          The String to write
                  Colour        The Colour Attribute of the string (0-255)

Remarks      :    The String can be written to any page.
                  No CR+LF is sent (see DspLnColour).

{------------------------------------------------------------------------------}
DspEnd                                                                  Scr88_21


Description  :    Write a string and clear the remaining specified length.

Declerations :    Procedure DspEnd(Strx: Stype; X_Pos,Y_Pos,Length,Colour: Byte);



Parameters   :    Strx          The String to write
                  X_Pos         The Column position starting coordinate
                  Y_Pos         The row position starting coordinate
                  Length        The length of the line

Remarks      :    This will write a string on a specified position
                  and will the clear characters following the string
                  until the Length is met.

{------------------------------------------------------------------------------}
DspJust                                                                 Scr88_21


Description  :    Write a String with justified positions.

Declerations :    Procedure DspJust(Strx: Stype; X_Pos,Y_Pos,Colour: Byte);



Parameters   :    Strx          The String to write
                  X_Pos         The Column Staring position
                  Y_Pos         The Row staring position
                  Colour        The Colour Attribute of the string (0-255)

Remarks      :    This will write a string and justify it against a
                  specified column and row position.

{------------------------------------------------------------------------------}
Dspln                                                                   Scr88_21


Description  :    Write and Memory-map Strings to the screen.

Declerations :    Procedure Dspln(Strx: Stype);



Parameters   :    Strx          The String to write

Remarks      :    The String can be written to any page.
                  The Colour Attribute of the string is set to
                  the global variable TEXTATTR.
                  A CR+LF is sent to the end of he String.

{------------------------------------------------------------------------------}
DspLnColour                                                             Scr88_21


Description  :    Write and Memory-map Strings to the screen.

Declerations :    Procedure DspLnColour(Strx: Stype; Colour: Byte);



Parameters   :    Strx          The String to write
                  Colour        The Colour Attribute of the string (0-255)

Remarks      :    The String can be written to any page.
                  A CR+LF is sent to the end of the string automatically.

{------------------------------------------------------------------------------}
DspPart                                                                 Scr88_21


Description  :    Write and Portion of a string to the screen.

Declerations :    Procedure DspPart (Strx: Stype; Start,Numch,
                                          X_Pos,Y_Pos,Colour: Byte);


Parameters   :    Strx          The String to write
                  Start         Starting position in Strx
                  NumCh         Number of characters to write
                  X_Pos         The Column Staring position
                  Y_Pos         The row starting position
                  Colour        The Colour Attribute of the string (0-255)

Remarks      :    Like the Copy and write commands in the run time library
                  but much faster execution.


{------------------------------------------------------------------------------}
DspVert                                                                 Scr88_21



Description  :    Write and String vertically on the screen.

Declerations :    Procedure DspVert(Strx: Stype; X_Pos,Y_Pos,Colour: Byte);



Parameters   :    Strx          The String to write
                  X_Pos         The Column Staring position
                  Y_Pos         The Row staring position
                  Colour        The Colour Attribute of the string (0-255)

{------------------------------------------------------------------------------}
EraseFile                                                               Fil88_21

Description  :    Erases a Specified File

Declerations :    Function EraseFile(Name:String):Integer;


Parameters   :    Name          The Name of the File to be Erased

Remarks      :    EraseFile Return an Integer Value specifing the following
                  instances.

                                0 : Ok
                               -2 : File Not Found
                               -5 : Access Denied

{------------------------------------------------------------------------------}
FMovePointer                                                            Fil88_21


Description  :    Change Logical Read/Write Position in a File

Declerations :    Function FMovePointer(Handle:Integer; Mode:Integer;
                                        Offset:Longint; Var Location:
                                        Longint):Boolean;


Parameters   :    Handle        Handle Identifier Of The File
                  Mode          Method Code of Pointer Movement e.g.
                                0 = Move To Pos Cx:Dx
                                Bytes From The Beginning Of File

                                1 = Move To Pos Cx:Dx
                                Bytes Beyond Current Position

                                2 = Move To Pos Cx:Dx
                                Bytes Beyond End Of File

                  Offset        Offset in File Relative To Mode
                  Location      New File Pointer Location After Move


Remarks      :    FMovePointer Returns a Boolean Value specifing if the
                  Move was successful. e.g

                                True  : Move Ok
                                False : Something went wrong

{------------------------------------------------------------------------------}
FillScreen                                                              Grp88_21


Description  :    Fills an Area of the Screen with a specified Character.

Declerations :    Procedure FillScreen (Ch: Char; X_Pos,Y_Pos,X_Num,Y_Num,
                                     Colour: Byte);


Parameters   :    Ch            The Character used for filling
                  X_Pos         The Top Left Column Position of the Screen
                  Y_Pos         The Top Left Row Position of the Screen
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen
                  Colour        The Colour Attribute of the Character.

{------------------------------------------------------------------------------}
FreshChar                                                               Kbd88_21


Description  :    Clears The Keyboard Buffer and Returns Next KeyStroke.

Declerations :    Function FreshChar: Char;


Parameters   :    None

Notes        :    If an Extended code was used then Chr(0) is returned only.

{------------------------------------------------------------------------------}
Foreground                                                              Scr88_21


Description  :    Set up the Foreround Colour Attribute.

Declerations :    Procedure ForeGound(Code: Char);


Parameters   :    Code  :       Character Code from Table in Remarks.


Remarks      :    k     Black           K       Grey
                  b     Blue            B       Light Blue
                  g     Green           G       Light Green
                  c     Cyan            C       Light Cyan
                  r     Red             R       Light Red
                  m     Magenta         M       Light Magenta
                  y     Brown           Y       Yellow
                  w     White           W       Bright White


Also Note That Monochrome attributes are possible  e.g.


     Attribute                       ForeGround      BackGround
     =========                       ==========      ==========

     Normal                              w               k
     Intense                             W               k
     Underlined                          b               k
     Underlined & Intense                B               k
     Reverse                             k               w
     Blinking                            w               K
     Blinking & Intense                  W               K
     Blinking & Underlined               b               K
     Blinking & Intense & Inderlined     B               K
     Blinking & Reverse                  k               W
       

See Also BackGround

{------------------------------------------------------------------------------}
Formatleft                                                              Scr88_21


Description  :    Writes Strings on the screen with Formatting

Declerations :    Procedure Formatleft(Strx: Stype; How_Many: Integer; Colour: Byte);


Parameters   :    Strx          The String to Write
                  How_Many      Distance between Starting cursor position
                                and return cursor position.
                  Colour        The Colour Attribute of the String (0-255)


Remarks      :    This will write a String and move the cursor to a
                  position specified by How_Many. If How_Many is a positive
                  value then cursor is offset to the right from the initial
                  position. If How_Many is negative then the cursor is
                  moved to a position directly below the starting point.

{------------------------------------------------------------------------------}
FormatRight                                                             Scr88_21


Description  :    Writes Strings on the screen with Formatting

Declerations :    Procedure FormatRight(Strx: Stype; How_Many: Integer; Colour: Byte);


Parameters   :    Strx          The String to Write
                  How_Many      Distance between Starting cursor position
                                and return cursor position.
                  Colour        The Colour Attribute of the String (0-255)


Remarks      :    This will write a String and move the cursor to a
                  position specified by How_Many. If How_Many is a positive
                  value then cursor is offset to the right from the initial
                  position. If How_Many is negative then the cursor is
                  moved to a position directly below the starting point.



{------------------------------------------------------------------------------}
GetColour                                                               Scr88_21


Description  :    Get the attribute of a specified screen position.

Declerations :    Function  GetColour(X_Pos,Y_Pos: Byte): Byte;



Parameters   :    X_Pos         Column starting position
                  Y_Pos         Row starting position


{------------------------------------------------------------------------------}
Getpage                                                                 Scr88_21


Description  :    Get the Current Page.

Declerations :    Function  Getpage: Integer;



Parameters   :    None


{------------------------------------------------------------------------------}
GetScan                                                                 Kbd88_21


Description  :    Returns The Scan Code of Next Keystroke in Buffer

Declerations :    Function Getscan: Byte;


Parameters   :    None

{------------------------------------------------------------------------------}
Getverify                                                               Fil88_21

Description  :    Returns The Dos Verification Flag for Disk Writing

Declerations :    Function GetVerify : Boolean;



Parameters   :    None


{------------------------------------------------------------------------------}
Getvolume                                                               Fil88_21

Description  :    Returns The Disks Volume Label

Declerations :    Function Getvolume(Disk: Integer; Workarea: Pointer): Stype;



Parameters   :    Disk          Specified Disk Drive Integer e.g.
                                0   :  Current Drive        1   :  Drive A
                                2   :  Drive B              3   :  Drive C

                  WorkArea      A Pointer Array for Used Internaly in
                                the function.


{------------------------------------------------------------------------------}
InsKeyDown                                                              Kbd88_21


Description  :    Report if <Ins> Key is Pressed

Declerations :    Function InsKeydown: Boolean;


Parameters   :    None

{------------------------------------------------------------------------------}
InsKeyOn                                                                Kbd88_21


Description  :    Report if <Ins> Key is Currently On

Declerations :    Function InsKeyOn: Boolean;


Parameters   :    None

{------------------------------------------------------------------------------}
Intenseoff;                                                             Scr88_21

Description  :    Set Text Attribute To Intensity Off;

Declerations :    Procedure IntenseOff;



Parameters   :    None


{------------------------------------------------------------------------------}
Intenseon                                                               Scr88_21


Description  :    Set Text Attribute To Intense On;

Declerations :    Procedure IntenseOn;



Parameters   :    None


{------------------------------------------------------------------------------}
KeyPause                                                                Kbd88_21


Description  :    Makes any Key a Push-On and Release-Off Switch

Declerations :    Procedure Keypause (Code: Char; Ascii:
                                      Boolean; Wait_A,Wait_B: Byte);



Parameters   :    Code          The Key That is Used in keyPause
                  Ascii         True  = Code is 1 Byte Ascii Code
                                False = Code is Second Byte Of Extended Code

                  Wait_A        Time For Buffer Refresh Signal on Press
                  Wait_B        Time For Buffer Refresh Signal on Release

{------------------------------------------------------------------------------}
LastKey                                                                 Kbd88_21


Description  :    Return The Last Keyboard Code from the Buffer

Declerations :    Function LastKey: Char;

Parameters   :    None

Notes        :    If Buffer is emty then 255 is Returned of Hex($FF)
                  If an Extended code was used then Chr(0) is returned only.

{------------------------------------------------------------------------------}
Leftend                                                                 Str88_21


Description  :    Return the Left end of a string up to a specified
                  character.

Declerations :    Function Leftend(Var Strx: Stype; Border: Char): Stype;


Parameters   :    Strx          The String to be manipulated.
                  Border        The character at which the search stops

ErrReturn    :                  0 - Ok
                                1 - Character not Found


{------------------------------------------------------------------------------}
LeftShiftDown                                                           Kbd88_21


Description  :    Report if <Left Shift> Key is Pressed

Declerations :    Function LeftShiftdown: Boolean;


Parameters   :    None

{------------------------------------------------------------------------------}
Lowercase                                                               Str88_21


Description  :    Convert a string to Lowercase.

Declerations :    Procedure Lowercase(Var Strx: Stype);


Parameters   :    Strx          The String to be manipulated.


{------------------------------------------------------------------------------}
Nextkey                                                                 Kbd88_21


Description  :    Extracts Next KeyStroke from Buffer

Declerations :    Function Nextkey: Char;


Parameters   :    None

ErrReturn    :    0     =       Normal Ascii Return
                  1     =       Extended Code Return
                  2     =       Buffer is Empty

Notes        :    The KeyStroke is not removed from the Buffer.

{------------------------------------------------------------------------------}
Normal                                                                  Scr88_21


Description  :    Set Text Attribute To Normal;

Declerations :    Procedure Normal;



Parameters   :    None


{------------------------------------------------------------------------------}
NumLockDown                                                             Kbd88_21


Description  :    Report if <Num Lock> Key is Pressed

Declerations :    Function NumLockdown: Boolean;


Parameters   :    None

{------------------------------------------------------------------------------}
NumLockOn                                                               Kbd88_21


Description  :    Report if <Num Lock> Key is Currently On

Declerations :    Function NumLockOn: Boolean;


Parameters   :    None

{------------------------------------------------------------------------------}
OpenFile                                                                Fil88_21

Description  :    Opens a File with Specified Access

Declerations :    Function OpenFile(Name:String; Access:Integer):Integer;


Parameters   :    Name          The Name of the File to be Created
                  Access        The Access required for the file

                                0 = Read Only
                                1 = Write
                                2 = Read And Write

Remarks      :    OpenFile Returns  an Integer Value specifing the following
                  instances. If Greater or equal to 0 the the integer value
                  will designate the handle of the Opened file. This is
                  needed to close the file with CloseFile.

                             >= 0 : Ok (Returns Handle)
                               -2 : File Not Found
                               -4 : Too Many Open Files
                               -5 : Access Denied
                              -12 : Invalid Access


{------------------------------------------------------------------------------}
Overwrite                                                               Str88_21


Description  :    Overwrites part of a string with a passed substring.

Declerations :    Procedure Overwrite (Var Strx: Stype;
                                       SubStrx: Stype; Position: Integer);


                  Strx          The String to be manipulated.
                  SubStrx       The string that replaces Strx
                  Position      The position at which overwriting begins.

ErrReturn    :                  0 - Ok
                                1 - Error


{------------------------------------------------------------------------------}
Padcentre                                                               Str88_21


Description  :    Pads a string to a specified length at any position
                  in a character.

Declerations :    Procedure Padcentre(Var Strx: Stype; Ch: Char; Position,Length: Integer);


Parameters   :    Strx          The String to be manipulated.
                  Ch            Character used for padding
                  Position      The position at whic padding comences
                  Length        The New length of Strx

ErrReturn    :                  0 - Ok
                                1 - Error


{------------------------------------------------------------------------------}
Padends                                                                 Str88_21


Description  :    Extends a string by padding it at both ends.

Declerations :    Procedure Padends(Var Strx: Stype; Ch: Char; Length: Integer);


Parameters   :    Strx          The String to be manipulated.
                  Ch            Character used for padding
                  Length        The New length of Strx

ErrReturn    :                  0 - Ok
                                1 - Error


{------------------------------------------------------------------------------}
Padleft                                                                 Str88_21


Description  :    Pads the begining of a string and extends it a specified
                  length.

Declerations :    Procedure Padleft(Var Strx: Stype; Ch: Char; Length: Integer);


Parameters   :    Strx          The String to be manipulated.
                  Ch            Character used for padding
                  Length        New length of Strx

ErrReturn    :                  0 - Ok
                                1 - Error


{------------------------------------------------------------------------------}
Padright                                                                Str88_21


Description  :    Pads the end of a string and extends it a specified
                  length.

Declerations :    Procedure Padright(Var Strx: Stype; Ch: Char; Length: Integer);


Parameters   :    Strx          The String to be manipulated.
                  Ch            Character used for padding
                  Length        New length of Strx

ErrReturn    :                  0 - Ok
                                1 - Error


{------------------------------------------------------------------------------}
ReadChar                                                                Kbd88_21


Description  :    Returns The Full Ascii Keystroke from the Buffer

Declerations :    Function Readchar: Char;

Parameters   :    None

Notes        :    Full Ascii Keystrokes includes Control Characters
                  and other special codes.
                  E.g  <Tab> <BackSpace> <Return> <End>


{------------------------------------------------------------------------------}
ReadFile                                                                Fil88_21

Description  :    Reads a File To a Buffer

Declerations :    Function ReadFile(Handle:Word; Amount:Word; Var Buff):Integer;


Parameters   :    Handle        Handle Identifier Of The File
                  Amount        Number Of Bytes To Read
                                Record Size <= $7fff Bytes
                  Buff          Pointer To Address Of Data Buffer


Remarks      :    ReadFile Returns an Integer Value specifing the number of
                  bytes actually read into the buffer, or the following
                  codes if not successfull

                             >= 0 : Ok (Returns Bytes Read)
                               -5 : Access Denied
                               -6 : Invalid Handle

{------------------------------------------------------------------------------}
Readsector                                                              Fil88_21

Description  :    Reads 512 bytes of a specified Disk Sector to a Buffer

Declerations :    Procedure Readsector(Segment,Offset,Drive,Sector,Number: Word);



Parameters   :    Segment       The Segment of the Array Buffer Object
                  Offest        The Offset for The Segment
                  Drive         The Specified Drive  1 = A, 2 = B, 3 = C etc.
                  Sector        The Logical Sector Number
                  Number        Number of Sectors to Read


ErrReturn    :                  0 - Ok
                                1 - Invalid Format on Disk
                                2 - Write Protection Error
                                3 - Sector Number is Invalid
                                4 - Hardware Failure

{------------------------------------------------------------------------------}
Replace                                                                 Str88_21


Description  :    Deletes a specified number of characters and inserts
                  new substring.

Declerations :    Procedure Replace(Var Strx: Stype;
                                    SubStrx: Stype; position,Chars: Integer);



Parameters   :    Strx          The String to be manipulated.
                  SubStrx       The String to be Inserted
                  Position      The position at which replacement starts
                  Chars         The number of characters deleted prior
                                to insertion.


ErrReturn    :                  0 - Ok
                                1 - Error

Remarks      :    Same operation as Insert and Delete commands in the
                  run time library but faster execution.


{------------------------------------------------------------------------------}
RestoreScreen                                                           Grp88_21


Description  :    Restore a previously saved image to the screen.

Declerations :    Procedure RestoreScreen (Box: Pointer; X_Pos,Y_pos,X_Num,Y_Num:
                                        Byte);


Parameters   :    Box           Byte Array Pointer that holds Screen Contents
                  X_Pos         The Top left Column position
                  Y_pos         The Top left Row Position
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen

{------------------------------------------------------------------------------}
Reverse;                                                                Scr88_21


Description  :    Set Text Attribute To Reverse;

Declerations :    Procedure Reverse;



Parameters   :    None


{------------------------------------------------------------------------------}
Rightend                                                                Str88_21


Description  :    Return the Right end of a string up to a specified
                  character.

Declerations :    Function Rightend(Var Strx: Stype; Border: Char): Stype;


Parameters   :    Strx          The String to be manipulated.
                  Border        The character at which the search stops

ErrReturn    :                  0 - Ok
                                1 - Character not Found


{------------------------------------------------------------------------------}
RightShiftDown                                                          Kbd88_21


Description  :    Report if <Right Shift> Key is Pressed

Declerations :    Function RightShiftdown: Boolean;


Parameters   :    None

{------------------------------------------------------------------------------}
RotateByteLeft                                                          Bit88_21


Description  :    Rotate the Bits of a Byte Left.

Declerations :    Function RotateByteLeft (Work_,Bits_ : Byte): Byte;


Parameters   :    Work_         The Byte that is converted
                  Bits_         Number of Bits to be Rotated

{------------------------------------------------------------------------------}
RotateByteRight                                                         Bit88_21


Description  :    Rotate the Bits of a Byte Right.

Declerations :    Function RotateByteRight (Work_,Bits_ : Byte): Byte;


Parameters   :    Work_         The Byte that is converted
                  Bits_         Number of Bits to be Rotated


{------------------------------------------------------------------------------}
RotateWordLeft                                                          Bit88_21


Description  :    Rotate the Bits of a Word Left.

Declerations :    Function RotateWordLeft (Work_ : Word;
                                           Bits_ : Byte): Word;


Parameters   :    Work_         The Word that is converted
                  Bits_         Number of Bits to be Rotated

{------------------------------------------------------------------------------}
RotateWordRight                                                         Bit88_21


Description  :    Rotate the Bits of a Word Right.

Declerations :    Function RotateWordRight (Work_ : Word;
                                           Bits_ : Byte): Word;


Parameters   :    Work_         The Word that is converted
                  Bits_         Number of Bits to be Rotated

{------------------------------------------------------------------------------}
RowColour                                                               Scr88_21


Description  :    Change The Attribute of a Row of Text.

Declerations :    Procedure Rowcolour(X_Pos,Y_Pos,X_Num,Colour: Byte);



Parameters   :    X_Pos         Column Position Coordinate
                  Y_Pos         Row Position Coordinate
                  X_Num         Number of Rows Wide affecting Attribute
                  Colour        The Attribute (0-255)


Remarks      :    The Text inside the area is left un altered.

{------------------------------------------------------------------------------}
SaveScreen                                                              Grp88_21


Description  :    Copy the Contents of a Screen Area into a Byte Array
                  including Screen Attributes.

Declerations :    Procedure SaveScreen(Box: Pointer; X_Pos,Y_pos,X_Num,Y_Num: Byte);


Parameters   :    Box           Byte Array Pointer that holds Screen Contents
                  X_Pos         The Top left Column position
                  Y_pos         The Top left Row Position
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen

{------------------------------------------------------------------------------}
ScreenColour                                                            Scr88_21


Description  :    Change The Attribute of a Boxed Area.

Declerations :    Procedure ScreenColour(X_Pos,Y_Pos,X_Num,Y_Num,Colour: Byte);



Parameters   :    X_Pos         Column Position Coordinate
                  Y_Pos         Row Position Coordinate
                  X_Num         Number of Columns Wide
                  Y_Num         Number of Rows Deep
                  Colour        The Attribute (0-255)


Remarks      :    The Text inside the box is left un altered.


{------------------------------------------------------------------------------}
ScreenDown                                                              Grp88_21


Description  :    Moves an Area of the Screen Down 1 Row

Declerations :    Procedure ScreenDown (Box: Pointer; Var X_Pos,Y_Pos:
                                     Byte; X_Num,Y_Num: Byte);


Parameters   :    Box           Byte Array Pointer that holds Screen Contents
                  X_Pos         The Top Left Column Position of the Screen
                  Y_Pos         The Top Left Row Position of the Screen
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen

Notes        :    The Screen area is moved down only by Row as the routine
                  lends itself to scrolling an area of the screen when the
                  routine is put in a loop.
                  The Previous screen area can be saved prior to calling
                  this routine with SaveScreen and so reference is made to the
                  Box Pointer Variable.

{------------------------------------------------------------------------------}
ScreenLeft                                                              Grp88_21


Description  :    Moves an Area of the Screen Left 2 Columns

Declerations :    Procedure ScreenLeft (Box: Pointer; Var X_Pos,Y_Pos:
                                     Byte; X_Num,Y_Num: Byte);


Parameters   :    Box           Byte Array Pointer that holds Screen Contents
                  X_Pos         The Top Left Column Position of the Screen
                  Y_Pos         The Top Left Row Position of the Screen
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen

Notes        :    The Screen area is moved Left only by 2 Columns as the
                  routine lends itself to scrolling an area of the screen
                  when the  routine is put in a loop.
                  The Previous screen area can be saved prior to calling
                  this routine with SaveScreen and so reference is made to the
                  Box Pointer Variable.

{------------------------------------------------------------------------------}
ScreenRight                                                             Grp88_21


Description  :    Moves an Area of the Screen Right 2 Columns

Declerations :    Procedure ScreenRight (Box: Pointer; Var X_Pos,Y_Pos:
                                     Byte; X_Num,Y_Num: Byte);


Parameters   :    Box           Byte Array Pointer that holds Screen Contents
                  X_Pos         The Top Left Column Position of the Screen
                  Y_Pos         The Top Left Row Position of the Screen
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen

Notes        :    The Screen area is moved Right only by 2 Columns as the
                  routine lends itself to scrolling an area of the screen
                  when the  routine is put in a loop.
                  The Previous screen area can be saved prior to calling
                  this routine with SaveScreen and so reference is made to the
                  Box Pointer Variable.

{------------------------------------------------------------------------------}
ScreenUp                                                                Grp88_21


Description  :    Moves an Area of the Screen Up 1 Row

Declerations :    Procedure ScreenUp (Box: Pointer; Var X_Pos,Y_Pos:
                                     Byte; X_Num,Y_Num: Byte);


Parameters   :    X_Pos         The Top Left Column Position of the Screen
                  Y_Pos         The Top Left Row Position of the Screen
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen

Notes        :    The Screen area is moved Up only by Row as the routine
                  lends itself to scrolling an area of the screen when the
                  routine is put in a loop.
                  The Previous screen area can be saved prior to calling
                  this routine with SaveScreen and so reference is made to the
                  Box Pointer Variable.

{------------------------------------------------------------------------------}
ScrollLockLockDown                                                      Kbd88_21


Description  :    Report if <Scroll Lock> Key is Pressed

Declerations :    Function ScrollLockdown: Boolean;


Parameters   :    None

{------------------------------------------------------------------------------}
ScrollLockOn                                                            Kbd88_21


Description  :    Report if <Scroll Lock> Key Currently On

Declerations :    Function ScrollLockOn: Boolean;


Parameters   :    None


{------------------------------------------------------------------------------}
Scrollx                                                                 Grp88_21


Description  :    Scroll a Defined area of the Screen Left Or right.


Declerations :    Procedure Scrollx (Where: Char; X_Pos,Y_pos,X_Num,Y_Num,
                                        X_Pos,Colour: Byte);


Parameters   :    Where         The Direction Characters E.g.
                                'L'   -  Scroll Left
                                'R'   -  Scroll Right

                  X_Pos         The Top left Column position
                  Y_pos         The Top left Row Position
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen
                  X_Pos         The Number of Columns to be shifted
                  Colour        The Attribute to clear Empty Columns


{------------------------------------------------------------------------------}
Scrolly                                                                 Grp88_21


Description  :    Scroll a Defined area of the Screen Up Or Down.


Declerations :    Procedure Scrolly (Where: Char; X_Pos,Y_pos,X_Num,
                                        Y_Num,Lines,Colour: Byte);


Parameters   :    Where         The Direction Characters E.g.
                                'U'   -  Scroll Up
                                'D'   -  Scroll Down

                  X_Pos         The Top left Column position
                  Y_pos         The Top left Row Position
                  X_Num         The Number of Colums of the Screen
                  Y_Num         The Number of Rows of the Screen
                  Lines         the Number of Rows to be Shifted
                  Colour        The Attribute to clear Empty Columns


{------------------------------------------------------------------------------}
Seekstring                                                              Str88_21


Description  :    Searches for a Substring within a String

Declerations :    Function Seekstring (Strx,SubStrx: Stype;
                                       Startpt: Integer):Integer;


Parameters   :    Strx          The String to be manipulated.
                  SubStrx       The String that is searched
                  Startpt       The starting position of the search

ErrReturn    :                  0 - Ok
                                1 - Error


{------------------------------------------------------------------------------}
SetCapsLock                                                             Kbd88_21


Description  :    Turn On the <Caps Lock> Key.

Declerations :    Procedure Setcapslock;


Parameters   :    None

{------------------------------------------------------------------------------}
SetColour                                                               Scr88_21


Description  :    Set the attribute at the specified screen position.

Declerations :    Procedure SetColour(X_Pos,Y_Pos,Colour: Byte);



Parameters   :    X_Pos         Column starting position
                  Y_Pos         Row starting position
                  Colour        The Colour Attribute (0-255)


{------------------------------------------------------------------------------}
SetNumLock                                                              Kbd88_21


Description  :    Turn On the <Num Lock> Key.

Declerations :    Procedure SetNumlock;


Parameters   :    None

{------------------------------------------------------------------------------}
Setpage                                                                 Scr88_21


Description  :    Set the Current Page.

Declerations :    Procedure Setpage(Pagenumber: Integer);



Parameters   :    PageNumber    The Page Number

Remarks      :    The page Number is 0-7 for the VGA and EGA Cards.
                  A Monochrome Card has only one Page.

{------------------------------------------------------------------------------}
SetScrollLock                                                           Kbd88_21


Description  :    Turn On the <Scroll Lock> Key.

Declerations :    Procedure SetScrollLock;


Parameters   :    None

{------------------------------------------------------------------------------}
Setverify                                                               Fil88_21


Description  :    Change the The Dos Verification Flag for Disk Writing

Declerations :    Procedure SetVerify (Setting: Boolean);



Parameters   :    Setting        True for Verification
                                 False For No Verification


{------------------------------------------------------------------------------}
Setvolume                                                               Fil88_21

Description  :    Change the Volume Label of a Disk.

Declerations :    Procedure Setvolume (Disk: Integer; Newlabel:
                                       Stype; Workarea: Pointer);


Parameters   :    Disk          The Specified Drive  1 = A, 2 = B, 3 = C etc.
                  NewLabel      New Volume Label Name [Max 11 Characters]
                  WorkArea      A Pointer Array for Used Internaly in
                                the function.


{------------------------------------------------------------------------------}
StringEnd                                                               Str88_21


Description  :    Returns a specified number of characters from the end
                  of a string.

Declerations :    Function StringEnd(Strx: Stype; Numberchars: Integer): Stype;


Parameters   :    Strx          The string to be manipulated.
                  Numberchars   The Number of characters returned

ErrReturn    :                  0 - Ok
                                1 - Strx is NULL
                                2 - Other Error

{------------------------------------------------------------------------------}
StringOf                                                                Str88_21


Description  :    Makes a new String made up of repetitions of a
                  substring.

Declerations :    Function StringOf(Strx: Stype; Length: Integer): Stype;


Parameters   :    Strx          The String to be manipulated.
                  Length        Length of the string returned.

ErrReturn    :                  0 - Ok
                                1 - Error


{------------------------------------------------------------------------------}
SwapPage                                                                Grp88_21


Description  :    Exchage All memory allocated to a page to a byte Array.

Declerations :    Procedure SwapPage(Box: Pointer; Pagenumber: Byte);


Parameters   :    Box           Array for Storing the Image
                  PageNumber    The Page Number

Notes        :    See GetPage.

{------------------------------------------------------------------------------}
Uppercase                                                               Str88_21


Description  :    Convert a string to Uppercase.

Declerations :    Procedure Uppercase(Var Strx: Stype);


Parameters   :    Strx          The String to be manipulated.



{------------------------------------------------------------------------------}
Wordcount                                                               Str88_21


Description  :    Counts the number of words ins a given string.

Declerations :    Function Wordcount(Strx: Stype): Integer;


Parameters   :    Strx          The String to be manipulated.


Remarks      :    A word is considered to be any series of characters
                  appart from the space character (#32).


{------------------------------------------------------------------------------}
Wordtohex                                                               Bit88_21


Description  :    Convert a Word Variable To Hex.

Declerations :    Function ByteToHex (Work_ : Word) :Stype;


Parameters   :    Work_         The Word theat is converted


{------------------------------------------------------------------------------}
WriteFile                                                               Fil88_21

Description  :    Writes To a File

Declerations :    Function WriteFile(Handle:Integer; Nwrite:Word; Var Buff):Integer;


Parameters   :    Handle        Handle Identifier Of The File
                  Nwrite        Number Of Bytes To Write
                                Record Size <= $7fff Bytes

                  Buff          Pointer To Address Of Data Buffer


Remarks      :    WriteFile Returns an Integer Value specifing the number of
                  bytes actually written, or the following codes if not
                  successfull

                             >= 0 : Ok (Returns Bytes Written)
                               -5 : Access Denied
                               -6 : Invalid Handle


{------------------------------------------------------------------------------}
Writesector                                                             Fil88_21

Description  :    Reads 512 bytes of a specified Disk Sector to a Buffer

Declerations :    Procedure Writesector(Segment,Offset,Drive,Sector,Number:
                                        Word;);


Parameters   :    Segment       The Segment of the Array Buffer Object
                  Offest        The Offset for The Segment
                  Drive         The Specified Drive  1 = A, 2 = B, 3 = C etc.
                  Sector        The Logical Sector Number
                  Number        Number of Sectors to Read


ErrReturn    :                  0 - Ok
                                1 - Invalid Format on Disk
                                2 - Write Protection Error
                                3 - Sector Number is Invalid
                                4 - Hardware Failure


