
                                    ANGELIB for BC7/PDS                        i
                                    ___________________





                _|||||_  ||_  ||  _|||||_  |||||||  ||       ||  |||||||
                ||   ||  |||_ ||  ||   ||  ||       ||       ||  ||    ||
                ||   ||  ||||_||  ||       ||       ||       ||  ||    ||
                |||||||  || ||||  || ||||  |||||    ||       ||  |||||||
                ||   ||  || ||||  ||   ||  ||       ||       ||  ||    ||
                ||   ||  ||  |||  ||   ||  ||       ||       ||  ||    ||
                ||   ||  ||   ||   |||||   |||||||  |||||||  ||  |||||||



                                         CONTENTS



          I.    DISCLAIMER OF WARRANTY  . . . . . . . . . . . . . . . . . .    1

          II.   COPYRIGHT . . . . . . . . . . . . . . . . . . . . . . . . .    1

          III.  LICENSE . . . . . . . . . . . . . . . . . . . . . . . . . .    1

          IV.   TECHNICAL SUPPORT (HOW TO REACH ME) . . . . . . . . . . . .    2

          V.    INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . . .    2

          VI.   NOTES ABOUT THIS RELEASE  . . . . . . . . . . . . . . . . .    3

          VII.  REGISTRATION  . . . . . . . . . . . . . . . . . . . . . . .    4
                A. How To Order . . . . . . . . . . . . . . . . . . . . . .    4
                B. Pricing  . . . . . . . . . . . . . . . . . . . . . . . .    5
                C. Complimentary Registered Editions  . . . . . . . . . . .    6
                COMPLIMENTARY REGISTRATION APPLICATION  . . . . . . . . . .    7

          VIII. SYSTEM REQUIREMENTS . . . . . . . . . . . . . . . . . . . .    9

          IX.   FILES WHICH MAKE UP ANGELIB . . . . . . . . . . . . . . . .    9

          X.    USING ANGELIB . . . . . . . . . . . . . . . . . . . . . . .    9

          XI.   REFERENCE . . . . . . . . . . . . . . . . . . . . . . . . .   10
                A. Routines Contained in SAMPLE.LIB . . . . . . . . . . . .   10

          XII.  USING PRINTER FUNCTIONS . . . . . . . . . . . . . . . . . .   46




















                                    ANGELIB for BC7/PDS                        1
                                    ___________________




          I.    DISCLAIMER OF WARRANTY

                I use the routines in ANGELIB almost every day as I write
          software and I am regularly adding, enhancing, or fixing.  My software
          will never be "done," and I hope that it gets better and better.  In
          any case, I can't guarantee that it's perfect; in fact, I'll guarantee
          that it's not.  By using this software and documentation ("ANGELIB")
          you must accept this disclaimer of warranty:

                ANGELIB is provided "as is" without any warranties or
          conditions, expressed or implied, including, but not limited to, those
          concerning merchantability and fitness for a particular purpose.  By
          using ANGELIB, you are expressly releasing the author, Angel Babudro,
          from any liability resulting from the use of this software and
          documentation.  You must assume the entire risk of using ANGELIB.


          II.   COPYRIGHT

                The author retains the copyright for all ANGELIB source code,
          documentation, assorted files, and all libraries.  However, once
          provided with registration from the author you may distribute any
          program you write with the benefit of ANGELIB, in compiled form only,
          without royalties to the author.  You must have written consent from
          the author prior to distributing ANGELIB source code in part or in
          whole, whether modified or in original form.


          III.  LICENSE

                1.  ANGELIB is being distributed as Shareware.  This library is
          not free, although license is hereby granted for evaluation of the
          Unregistered Edition for an unlimited time.

                2. You may keep as many backup copies of ANGELIB as you wish and
          use ANGELIB simultaneously on any number of computers during the
          evaluation period.  Additionally, you are granted the right to share
          the Unregistered Edition of ANGELIB with others, as long as you
          distribute the archive exactly as you received it, with all associated
          files included.  PLEASE DO NOT distribute the separate Registered
          Edition file ANGEL.LIB nor any of the files ending in "OBJ".

                3. Under no circumstances may you charge any fee or receive any
          other form of consideration for distributing the ANGELIB files without
          express written consent from the copyright holder, Angel Babudro,
          other than to charge a fee of not more than US$6 (six dollars) which
          shall be solely for the disk or service of distribution.  (Put another
          way, I sell the software, you sell your service.)















                                    ANGELIB for BC7/PDS                        2
                                    ___________________




          IV.   TECHNICAL SUPPORT (HOW TO REACH ME)

                If my wording is unclear or can't find some topic in here, give
          me a holler and help me fix it or add it to the manual.  A letter or
          BBS message is preferred (and less expensive for you) but phone calls
          are fine between 9am and 5pm Eastern Time as long as you are a
          registered user or intend to become one.  I thank you for your help in
          making this library better.

                Check out the Registration section below for ways to get a free
          registered copy of ANGELIB.  Sysops please read SYSOP.DOC for special
                             _______
          deals.  Shareware vendors please see VENDOR.DOC for distribution
          information.

                I can be reached via the mail or BBS.  The bulletin boards below
          should always have current versions of all my software and I will get
          any messages left there for me.

                Mail        Angel Babudro, "Organic Computer Wizardry",
                            28 Mulberry Street, Clinton, NY  13323-1506,
                            (315) 853-1070 Mon-Fri 9am-5pm Eastern Time

                BBS         Angelo Babudro (to avoid gender confusion)
                West Coast  Researcher's BBS, So Cal (805) 949-8151 USR HST DS
                East Coast  Nite Air BBS, Central NY (315) 339-8831 USR HST 14.4


          V.    INTRODUCTION

                ANGEL.QLB is a "high level" BC7 library for developing business
          applications, especially data base uses.  These are the routines I use
          in developing my apps (with some help from three other shareware
          libraries, most notably John Strong's EZ-Windows which is terrific).

                I put in the things that are simple but a pain to code every
          time, like a "percent completed" bar graph in a window, and things
          that are more complicated, such as a scrollable information window
          with mouse support.  ANGELIB is written in BASIC, but even though it's
                               _______
          probably not the "tightest" code of its kind I think you will find it
          very easy to use.

                Some of my routines trade flexibility for ease of use, like the
          percentage graph which is always the same colour and at the same spot
          on the screen.  This keeps things simple and provides built-in
          consistency.  Just in case my ideas for standards aren't the same as
          yours :) I have decided to offer the licensing of my source code.

















                                    ANGELIB for BC7/PDS                        3
                                    ___________________




                Well, what more can I say?  I hope my library helps you to write
          a bit better and faster.  If so maybe I'll see your registration in my
          mail someday.


          VI.   NOTES ABOUT THIS RELEASE

                Every release fixes bugs found in previous releases and adds a
          few new features.

          Release 1.8d
          ____________

                Parameter list modified in HelpIndex, SayOk, OutDev$, and
          ChooseFile$

                Bugs fixed in ChooseFile$, FontDL, Inform%, GetFileName$,
          IsPath%, SelectFont%, SelectFontSize%, and StrFmt$

                Usage of existing parameters changed for Inform%, SelectFont%

                Minor changes in function made to Repl$


          Release 1.8c
          ____________

                Please ** N O T E ** Without thinking I had made a poor choice
          for the InOut% variable passed to GetFileName$.  I've had trouble
          remembering its settings and just realized how obvious it is that zero
          (0) is like "O" (for Output) and one (1) is like "I" (for Input). 
          This just makes too much sense to be ignored, so I have reversed this
          variable's functions from previous releases.

                New routines since 1.8b:
                  DBFShowFields subroutine
                  IsPath% function
                  BackupMsg subroutine

                As my experience broadens I notice things that escaped my
          attention while I was focused on coding these routines.  Changing
          parameters makes me nervous - I don't want to cause any problems for
          anyone (including myself), but there are some cases where I had to do
          it: GetFileName$ now includes a default file name (now how did I
          forget that?).

                The next most nervous thing to do is change the way a routine
          works.  I've been learning how to make my library more "well behaved"
          so that it does not affect the calling programme at all.  Programming
          for a mouse is relatively new to me, and my most recent lesson here is
          that you can't leave a mouse cursor visible while writing to the














                                    ANGELIB for BC7/PDS                        4
                                    ___________________




          screen or you will have "mouse droppings."  Thus, my programming
          method has changed from "turn the mouse on at the start and turn it
          off only as needed" to "just turn the mouse on when you need it."   So
          Inform%, GetValidPath$, GetFileName$, ChooseFile$, and any other
          mouse-using routine now assume that the mouse is initially OFF.


          VII.  REGISTRATION

                Although I hope that you are so happy with ANGELIB that
                                                           _______
          registering will be reward enough in itself, but I think it's more fun
          & exciting to get something new.  ANGELIB is the library I use for
                                            _______
          developing all of my applications, so it is constantly updated.  Your
          registered version will be an up-to-the-minute copy.  Other benefits
          of registration that come to my mind include:

                1.  You'll get complete LIB file and OBJ files so you can create
                    your own custom libraries.  I use the EZ-Windows and PBClone
                    libraries for some routines (why re-invent the wheel?), so
                    you will need to get them if you want to create custom
                    libraries.  The price of all three libraries (including
                    mine) is $70 which is not bad for three good libraries.
                2.  Within days you will get a library that would probably take
                    so long to develop yourself that by the time you've done it
                    you won't need it anymore
                3.  You can order a printed & bound manual for $8
                4.  Technical support is possible! You can contact a real
                    programmer who is 98% knowledgeable about the library
                    (nobody's prefect) via mail, phone, or BBS
                5.  You'll have helped one of the little guys - someone who
                    isn't a huge corporation.  (Thank you...)

                A.  How To Order

                U.S. customers please send cash, check, or money order. 
          Canadian customers please send cash or Canadian International Money
          Order (CIMO).  Customers in other countries please send U.S. funds
          drawn on a U.S. bank.  If you send cash use a "security" no-see-
          through envelope and you may want to send it via Registered mail, too.

                If you prefer to use a credit card, you can order ANGELIB from
          Public (software) Library with your MC, Visa, AmEx, or Discover card
          by calling 800-242-4PsL (from overseas: 713-524-6394) or by FAX to
          713-524-6398 or by CompuServe to 71355,470.  THESE NUMBERS ARE FOR
          ORDERING ONLY.  I CANNOT be reached at those numbers.  To contact me
          for information about dealer pricing, volume discounts, site
          licensing, the status of shipment of the product, the latest version
          number, or for technical information, call 315-852-6942 or write me at
          28 Mulberry Street, Clinton, NY USA 13323-1506.  Shareware is "try














                                    ANGELIB for BC7/PDS                        5
                                    ___________________




          before you buy" so please understand that product returns are not
          allowed.

                Please note that PsL will add $3 for shipping & handling to U.S.
          as well as Canadian orders.

                B. Pricing

          Registration with Disk -- A single copy costs $25.  You will receive
                the latest version of ANGELIB in QLB (for use with QBX), LIB (so
                                      _______
                it can be merged with other libraries), and OBJ (where possible;
                to make custom libraries) formats.  You will also receive
                notification of major updates.  At this time, updates for
                registered users are $5 or send me a disk and return postage
                (I'll re-use your envelope).  See below for printed manuals.

          Multiple Copies -- Each copy may be used on a single computer at a
                time.  To ease the financial burden and thank you for being
                honest, you may apply the following discounts when ordering more
                than one copy:
                2 to 5 copies                                       40% discount
                Over 5 copies                                       50% discount

          Site License -- Register a single copy of ANGELIB and purchase a site
                                                    _______
                license which allows you to make copies of the registered
                version for use on more than one computer owned by the same
                business.  I would prefer that you order a registered copy and
                Site License for each physical location of the same business,
                but this is not required unless you would like to receive update
                notices at each location.
                   Up to 4 computers                             $30.00 per site
                   Up to 10 computers                            $70.00 per site
                   Up to 20 computers                           $125.00 per site
                   Any number of computers                      $400.00 per site

          Manuals -- I will print the latest version of the manual you are
                reading right now (using Ventura Publisher and a laser printer)
                and bind it.  I am offering this as a service to those who want
                a printed, bound manual with their software.  Most of the cost
                involved here is for materials and extra shipping costs. 
                Remember that ASCII and WP documentation files are always on
                disk and if you provide your printer model on the registration
                form I will send you a file ready to print on your printer.
                -  One copy                                                $8.00
                -  Two or more copies                             $6.00 per copy

          Source Code License - You may license the use of the source code for
                ANGELIB for just $30.  Thereafter, updates will be available for
                $5 plus shipping.  Please note that I call routines from EZ-














                                    ANGELIB for BC7/PDS                        6
                                    ___________________




                Windows (by John Strong) and PBClone (by Tom Hanlin) in my
                library (why re-invent their wheels?), so you will need to
                register one or both of these to use a few OBJs in creating
                custom libraries.  I recommend both of them highly and will
                gladly share unregistered versions of these with you - just ask.

                C. Complimentary Registered Editions

                I would like to give away some complimentary registrations in
          return for a little bit of marketing assistance...

          1. If you write a review of one of my packages and post it on a
             bulletin board, send me a copy of it showing the BBS's header and
             the name and phone number of the BBS.  Just give me your honest
             praise and criticism in a decent review.  Your review will be most
             helpful to me if it mentions your best & worst-liked features and
             any ideas you have for improvement.  This will help me decide the
             future of ANGELIB and for that help I will send you a complimentary
             registered disk.

          2. It helps me to know which BBSs carry my software and the more the
             better, of course!  If you will upload a package to at least five
             public ("open") BBSs, send me their names and phone numbers and
             I'll send you a complimentary registered disk.  I would appreciate
             you uploading to time-share systems, private ("closed") BBSs, or
             part-time BBS, but please do not use these to apply for a
             complimentary registered edition.  BTW: I use an HST 14.4 modem so
             it would be best if you provided me with BBSs which also use HSTs
             so I can hook-up at high speed.

          3. If you are a consultant or other type of computer professional and
             your recommendation leads to one or more of your clients purchasing
             one of my packages, just send me a note with your client's
             registration or have them mention your name when they register.  I
             will send a complimentary registered edition or an update for every
             registration you get for me.  This is in lieu of a multiple copy
             discount; I intend it for consultants who choose not to deal with
             sales tax.

                I want your help with distribution, but please remember that
          this is not Microstuff Corp. - it's just me and my computer so please
          give me the help I need in return for the freebie.  It helps a lot
          when you send back disks to be re-used - even the envelopes can often
          be re-used.  When you order a complimentary registration please fill
          in the appropriate blanks below PLUS the Invoice so I know what size
          disk you need, etc.

















                                    ANGELIB for BC7/PDS                        7
                                    ___________________




                          COMPLIMENTARY REGISTRATION APPLICATION

                Please also fill in the Invoice on the following page (put $0
          for the disk price and cross out the $2.00 for shipping).  For
          addresses outside the U.S. please add the extra shipping indicated -
          foreign shipping is a little too pricey for me to give away.  If you
          want anything extra, like a printed manual, please include payment for
          these extra items.


          (__) Review posted on (BBS name & number)________________________
                Include a copy of the review, please. Thank you very much!

          (__) I uploaded (archive name, like ANGEL18D.ARJ)__________________
                to these five 24-hour public ("open") BBSs:

             BBS Name              Phone Number/Modem Type  Sysop Name
             ________              _______________________  __________

          1_______________________ ________________________ _______________
          2_______________________ ________________________ _______________
          3_______________________ ________________________ _______________
          4_______________________ ________________________ _______________
          5_______________________ ________________________ _______________

             These offers subject to withdrawal or change at any time without
          notice.  All prices are subject to change without notice.  Bulletin
          Board Sysops please see the file SYSOP.DOC for special pricing and
          information; vendors & sysops please see VENDOR.DOC.

                        Angel Babudro - "Organic Computer Wizardry"
                        28 Mulberry Street   Clinton, NY 13323-1506
                        (315) 853-6942 Mon-Fri 9am-5pm Eastern Time
               (home phone; remember we're 3 hours later than Pacific coast)

                          Please register the Shareware you keep.




























                                    ANGELIB for BC7/PDS                        8
                                    ___________________




                                                          INVOICE & REGISTRATION
                                     Credit card orders see "How To Order" above

          Your Name_____________________________________________________________

          Company Name__________________________________________________________

          Address_______________________________________________________________

          ______________________________________________________________________

          City___________________________ State/Prov________ Zip________________

          Registration     Registration & disk: $25 x qty _____        $_______ 

          Source Code      Source disk & license: $30 x qty _____       _______ 

          Multiple/        2-4 disks -- deduct 40%
          Wholesale        5 or more -- deduct 50%                     (_______)

          Site License     Up to 4 CPUs add $30; Up to 10 add $75
          (add to above)   Up to 20 add $150; Unlimited add $400        _______ 

          Printed          One copy is $8, 2 or more are $6 each
          Manuals          Qty _____ x $_____ each                      _______ 

          Shipping &       Canada, AK, HI, VI, PR add $3 extra          _______ 
           Expenses        Other countries add $9 per copy              _______ 

                           ** T O T A L **                              _______ 


          Disk size & quantity   [__] 3"                   [__] 5"
          Drive density          [__] Low (DD) required     [__] High (HD) okay
          Extended densities     [__] FDFORMAT extended densities okay

          Which version are you using now?_____________________________________

          Where did you get it?________________________________________________


          ANGELIB has been delivered to and accepted by customer.  Upon receipt
          of this paid invoice the latest Registered Edition disk and any
          options chosen above will be sent.  Send U.S. funds or CIMO.  NYS
          orders add local sales tax.  Mail this page with your cash (use
          Registered mail), cheque or money order to Angel Babudro, 28 Mulberry
          Street, Clinton, NY USA 13323-1506. Please allow 1-3 weeks. Thank you!
















                                    ANGELIB for BC7/PDS                        9
                                    ___________________




          VIII. SYSTEM REQUIREMENTS

                All you need is PC/MS-DOS 3.3 or later, PDS/BC 7.1, and a
          computer.  You will need 200k to 500k of disk space for the files,
          depending on which ones you decide to keep around.


          IX.   FILES WHICH MAKE UP ANGELIB

                The unregistered edition is made up of the following files:

                ANGEL.QLB     The Quick Library for use with QBX (start with
                              QBX /l ANGEL)
                SAMPLE.LIB    A sample library of routines (see below for list
                              of included routines)
                ANGEL.BI      The include file, function & subroutine
                              definitions
                COLOURS.BI    Colour codes definitions, use is optional
                FKEYS.BI      Function key definitions, use is optional
                ANGEL.TXT     The ASCII text file of this document
                ANGEL.WP      The WordPerfect file of this document (so you can
                              format it for your printer)
                QSORT.SUB     Source code to this public domain routine
                FKEY.LST      Sample file for use with FKEYS routine
                READ.ME       A file containing late-breaking news...  May or
                              may not be part of the package you get
                ORDER.FRM     Order form for all of my software
                SYSOP.DOC     Sysop information
                VENDOR.DOC    Disk vendors & Sysops: pricing, detailed
                              description, and distribution information
                COMPARE.EXE   A byte-by-byte file compare utility.  Displays in
                              hex, decimal, and ASCII. Type COMPARE for help.
                DUMP.EXE      Hex/octal/decimal file viewer. Type DUMP for help.

                The registered edition also includes:

                ANGEL.LIB     The link library file (which allows you to make
                              EXE files and to combine this library with others)
                *.OBJ         Object modules for creating custom libraries


          X.    USING ANGELIB

                Basically, just put the files wherever you want them and use the
          INCLUDE meta-command to place the .BI definition file in your
          programme (e.g., '$INCLUDE: 'Angel.bi').  Using the $INCLUDE file lets
          you call subroutines without the CALL key word.  When you start up QBX
          just use the format "QBX /L d:\path\ANGEL" - this will load the quick















                                    ANGELIB for BC7/PDS                       10
                                    ___________________




          library into memory so you can run the routines (it's a large library
          so you'll need enough memory to load it & run your code).

                The only limitation is that you can't compile with a QLB - you
          need the library (LIB) file, which I would like to sell you :) for
          $15.  For a free alternative, limit the routines to the ones included
          in SAMPLE.LIB (see below for list) and you can compile an EXE file
          (you may want to rename SAMPLE.LIB to ANGEL.LIB so QBX can find it). 
          You may use the routines in SAMPLE.LIB in code you write and
          distribute your programmes as long as you give me a copyright notice
          on the disk label.

                Rather than write a probably-lame demonstration programme to
          show off ANGELIB's functions, I would like to suggest that you check
          out my shareware from whence this library sprang:  What Mailing List?
          (WML), What Vehicle History? (WVH), What Job Summary? (WJS), What
          Floppy Format? (WFF), and What Tape Back-up (WTB).


          XI.   REFERENCE

                ANGELIB is made up of functions and subroutines.  Functions
                _______
          return a value to a variable - e.g., a% = CalcAttr(White, Blue) puts a
          value in a% - whereas subroutines do not - e.g., BackUpMsg just prints
          a message on the screen.

                The general syntax of a function call is
          var = Function(param1,param2,etc).  For a subroutine, the "formal"
          _________________________________
          syntax is "[CALL] subname(param1, param2, etc.)" although "CALL" is
                     ____________________________________
          not needed when you include ANGEL.BI in your code.

                Subroutines do not yield any "result," but they often modify one
          or more variables which are passed to them.  DBFHeader is a good
          example of this.

                The routines below each show their name at the left margin and a
          sample calling sequence aligned with the right margin, under which is
          the english explanation of the routine's purpose followed by the
          definition of variables.

                A.  Routines Contained in SAMPLE.LIB

                The SAMPLE.LIB library is an abbreviated library which contains
          the following routines:

                CalcAttr%     ChooseFile$    ContCan%       DateVal
                Delay         ErrScn         ErrSolve$      ErrText$
                FKeys         GetFontInfo    GoodByeScreen  Inform%
                IsColour%     IsPath%        Max%           Min%














                                    ANGELIB for BC7/PDS                       11
                                    ___________________




                MonthDays     ParseFSpec     PctDone        QSort
                Repl$         SayOk          SearchPath$    StrFmt$
                Trim$         zTrim$

                These are the only routines that you can use if you want to
          compile to an EXE using ANGELIB routines.  You may wish to rename
                                  _______
          SAMPLE.LIB to ANGEL.LIB so that you can compile from QBX.



          BackupMethod%                       Ok% = BackupMethod%(default%, ms%)
            Presents  a menu  of  back-up  methods, highlighting  the  default%
            entry.

            Pass
            ____
                 default%    Default (current) back-up method.
                             1 = DOS Copy
                             2 = ARJ
                             3 = LHARC
                             4 = PKZIP

                 ms%         Mouse support flag
                             0=no
                             1=yes

            Returns
            _______
                 TRUE (-1) if operation completed or FALSE if user cancels




          BackupMsg                                                    BackupMsg
            Prints  what I think of  as a pseudo-subliminal reminder to back-up
            your data   :)  A little reminder pops onto the screen for a second
            then the screen is cleared.

            Pass
            ____
                 Nothing

            Returns
            _______
                 Nothing






















                                    ANGELIB for BC7/PDS                       12
                                    ___________________




          CalcAttr%                             attr% = CalcAttr% (Fore%, Back%)
            For use with routines that need a single integer colour code.

            Pass
            ____
                 Fore%       Foreground colour code

                 Back%       Background colour code

            Returns
            _______
                 Fore% + (Back% * 16)




          ChooseCountry%                   Intl% = ChooseCountry%(default%, ms%)
            Presents a pop-up menu of four country choices.

            Pass
            ____
                 default%    The  current setting;  this is  the  seed for  the
                             pop-up menu.
                             1 = U.S.A. only
                             2 = Canada only
                             3 = U.S.A. and Canada only
                             4 = International

                 ms%         Indicates mouse support
                             0 = No mouse
                             1 = Mouse available
                             (Mouse must be initialized.  See MouseSet.)

            Returns
            _______
                 Menu item selected (1-4), or zero if user presses Esc































                                    ANGELIB for BC7/PDS                       13
                                    ___________________




          ChooseFD$                                             fdd$ = ChooseFD$
            This is a menu of available floppy disk drives.  The function:

            1.   Checks the number of floppy disk drives

            2.   If there is only one drive then "A:" is returned, otherwise

            3.   A pop-up  menu of  floppy drives is  presented from  which the
                 user may choose one or press Esc.

            Pass
            ____
                 Nothing

            Returns
            _______
                 Floppy disk  drive  letter followed  by a  colon, or  a  blank
                 string if user presses Esc.















































                                    ANGELIB for BC7/PDS                       14
                                    ___________________




          ChooseFile$         File$ = ChooseFile$(FSpec$,Exclude$,ExtInfo%,ms%))
            Presents  a  scrollable  list  of files  in  a  window which  match
            FileSpec$ (excluding Exclude$) and waits for user to choose one.

            Pass
            ____
                 FSpec$      File specification  to include in  the list.   May
                             include drive  and path name,  if necessary.   For
                             example, "*.DAT" or "C:\DATA\*.DAT" are valid.

                 Exclude$    File   specification  to  exclude  from  the  list
                             (e.g., "*.bak").   Do  not put a drive  or path in
                             this.

                 ExtInfo%    Extended  Information flag (true/false).  Controls
                             display of extended information (file size  & long
                             description).  If  a  file  DESCRIPT.*  is  in the
                             directory it will be used for file descriptions.

                 ms%         Mouse support flag (true/false).

            Returns
            _______
                 File name  chosen without  drive or path, or  null string ("")
                                   _______
                 if user presses Esc

            Notes
            _____
                 If ExtInfo%  is true  (non-zero)  then font  files (*.SFP  and
            *.SFL) will be shown with their font names and  other files will be
            shown with their  size & any description.   I patterned the  format
            of  the DESCRIPT.* file  after 4DOS: file name  followed by a space
            and up to 40 characters for the description.
                 4DOS  makes  a  hidden  file.    ChooseFile$  will  only  read
            "normal"  (not  hidden) files  right now.    I'll  soon have  it so
            ChooseFile$ will read hidden files, too.






























                                    ANGELIB for BC7/PDS                       15
                                    ___________________




          ChoosePort%                      PtrPort% = ChoosePort%(default%, ms%)
            Presents a pop-up menu of printer ports (LPT1, LPT2, and LPT3)  and
            waits for user to pick one or press Esc.

            Pass
            ____
                 default%    Default (current) printer port setting (1-3).

                 ms%         Mouse support available: 0 = No, 1 = Yes

            Returns
            _______
                 Port number (1-3) or zero if user presses Esc




          ChoosePtr%             Ok% = ChoosePtr%(pType$, PtrNo%, PtrPort%, ms%)
            Presents a  pop-up menu  of  printer choices  from the  PRINTER.DAT
            file.   If there are less than 15 choices (that is, all choices fit
            inside the window), then the default (PtrNo%) will be highlighted.

            Pass
            ____
                 pType$      Printer types to include in the menu:
                             D = Dot matrix printers
                             L = Laser printers
                             B = Both

                 PtrNo%      Record  number  of  currently  chosen  printer  in
                             PRINTER.DAT

                 ms%         0 = Keyboard only
                             1 = Use mouse, too

            Returns
            _______
                 pType$      Changed to  "D"  if dot  matrix chosen  or "L"  if
                             laser printer chosen

                 PtrNo%      PRINTER.DAT record number for the chosen printer

                 PtrPort%    The port number selected for the  printer (LPT1 is
                             1, LPT2 is 2, etc.) or zero if user presses Esc























                                    ANGELIB for BC7/PDS                       16
                                    ___________________




          ContCan%                                                 i% = ContCan%
            Displays  "Continue" and "Cancel" keys  at the bottom of the screen
            and waits for response.

            Pass
            ____
                 Nothing

            Returns
            _______
                 TRUE (-1) if user presses Esc
                 FALSE (0) if user presses Return (aka Enter)




          DateFmt$                  FormattedDate$ = DateFmt$(d%, m%, y%, intl%)
            I use this routine to print  the formatted date after getting input
            from  the user.   You  can  "PRINT DateFmt$()" or  assign it  to  a
            variable.  Use the ChooseCountry% menu to let the user set Intl%.

            Pass
            ____
                 d%          Day on the month
                 m%          Month number
                 y%          Year (4-digits)
                 Intl%       International formatting
                             1 = USA (mm/dd/yyyy)
                             2 = Canadian (dd-mm-yyyy)
                             3 = USA & Cdn (dd MoName yyyy)
                             4 = International (dd MoName yyyy)

            Returns
            _______
                 Formatted date




          DateVal%                                      dv% = DateVal%(TheDate$)



























                                    ANGELIB for BC7/PDS                       17
                                    ___________________




            Converts dates  from 1992  to 2078  to an integer  number for  date
            calculations.         For    example,     DateVal%(Date1$)    minus
            DateVal%(Date2$) would give you the number of days between the  two
            dates.  Years prior to 1992 are converted to 1992.

            Pass
            ____
                 TheDate$    Date string formatted  the same  as BASIC's  DATE$
                             function

            Returns
            _______
                 Integer value based on the date




          DBFHeader             DBFHeader file$, Fld$(), reclen%, recs&, NoFlds%
            Opens .DBF  file FileName$  and  returns field  names in  Field$(),
            record length in reclen%, number  of records in the file in  recs&,
            and number of  fields in NoFields%.   You can then  call DBFPickFld
            to pick fields from the list.  See also DBFPickFld function.

            Pass
            ____
                 file$       The DBF  file name, including  drive and path,  if
                             necessary

                 Fld$()      This array  must be  initialized prior  to calling
                             DBFHeader  to  the maximum  number  of  fields  (I
                             would suggest  setting it to  at least 50,  unless
                             you know better).

            Returns
            _______
                 Fld$()      The names of the fields.  The first field name  is
                             in Field$(1), etc.

                 reclen%     The file's record length

                 recs&       The number of records on file

                 NoFlds%     The number of fields
























                                    ANGELIB for BC7/PDS                       18
                                    ___________________




          DBFPickFld%                 fld% = DBFPickFld%(iRow%, iCol%, field$())
            Presents the  list of field  names of a .DBF file  at and waits for
            user to select one.   See also  DBFHeader which will fill  field$()
            with field names.

                 iRow%       Top row of window

                 iCol%       Left column of window

                 field$()    Array containing field names from which to choose

                 ms%         Mouse flag: 0 = no mouse, non-zero = use mouse



















































                                    ANGELIB for BC7/PDS                       19
                                    ___________________




          DBFShowFields       DBFShowFields row%, col%, show%, field$(), hilite%
            Displays a  window filled  with field names  found in  the field$()
            variable (which  can be  set via DBFHeader).   Field number hilite%
            will  be highlighted and  placed in  the centre  of the  window (if
            possible).

            Pass
            ____
                 row%        Top screen row of window (box corner)
                 col%        Top left corner of window
                 show%       Number of fields to show in the window

                 field$()    A  2-dimensional  array  field$(1-fieldnum,  0-2).
                             field$(fieldnum,0) is the field name
                             field$(fieldnum,1) is the field type
                             field$(fieldnum,2) is the field length

                             All you  need to do is dimension field$() and then
                             pass it to DBFHeader which will  fill it with  the
                             field specs.

                             Note:  DBFHeader sets  field$(1,x) to  "None"  and
                             this routine  also expects  field$(1,x) to be  the
                             "None" field.

                 hilite%     Indicates  the field  number to  highlight  on the
                             screen (a value of zero highlights  nothing).  The
                             first field  in the  window is  Max%(1,hilite%-5),
                             so if  hilite%=1,2,3,4, or  5 the  first field  in
                             the window is #1; if hilite%=6 the first  field is
                             #2, etc.

            Returns
            _______
                 Nothing




          Delay                                                       Delay Sec!
            Delays for Sec! seconds.  I use this for copyright messages, etc.

            Pass
            ____
                 Sec!        Number of seconds to delay (floating point)

            Returns
            _______
                 Nothing


















                                    ANGELIB for BC7/PDS                       20
                                    ___________________




          DrawFDD                                   DrawFDD Light%, iRow%, iCol%
            Draws a text picture of a floppy on the screen at iRow%,iCol%.   If
            Light% is  TRUE (-1)  then the  light blinks  red (bright  white on
            mono monitors), else it is white.

            Pass
            ____
                 Light%      True if drive "light" is to blink, false if not

                 iRow%       Top row of picture

                 iCol%       Left column of picture

            Returns
            _______
                 Nothing




          DrawHDD                             DrawHDD Light%, iRow%, iCol%, Msg$
            Similar  to DrawFDD but  draws a  text picture  of a hard  disk and
            places the current drive (CURDRIVE) letter in the box.

            Pass
            ____
                 Light%      True if drive "light" is to blink, else false

                 iRow%       Top row of picture

                 iCol%       Left column of picture

                 Msg$        A  message up  to 20  characters  long to  display
                             inside the  picture.  If  longer than  20 chars it
                             will be truncated.

            Returns
            _______
                 Nothing




























                                    ANGELIB for BC7/PDS                       21
                                    ___________________




          DrvSpace                         DrvSpace (Drive$, Total&, Free&, EC%)
            Returns total space and free space (in bytes) of drive Drive$.

            Pass
            ____
                 Drive$      Disk drive letter (e.g., "C")

            Returns
            _______
                 Total&      Total bytes are returned in this variable

                 Free&       Free bytes are returned in this variable

                 EC%         DOS error  code is  returned in  this variable  or
                             zero if no error





          ElapsedTime         ElapsedTime STime$, ETime$, Hour%, Minutes%, Secs%
            Calculates elapsed time.

            Pass
            ____
                 STime$      Starting  time  hh:mm:ss  (same  format  as  TIME$
                             function)

                 ETime$      Ending  time  hh:mm:ss  (same   format  as   TIME$
                             function)

            Returns
            _______
                 ETime$      Formatted elapsed time (hh:mm:ss)
                 Hour%       Elapsed hours
                 Minutes%    Elapsed minutes
                 Secs%       Elapsed seconds

            Example
            _______
                 S$ = TIME$              'Starting time
                 (do whatever needs to be done)
                 E$ = TIME$              'Ending time
                 ElapsedTime S$, E$, H%, M%, S%
























                                    ANGELIB for BC7/PDS                       22
                                    ___________________




          ErrScn                                        ErrScn ErrCode%, Module$
            Presents  an  error  screen showing  error  number,  english  text,
            possible solution, and module name.

            Pass
            ____
                 ErrCode%    Error number

                 Module$     Module name

            Returns
            _______
                 Nothing




          ErrSolve$                                            ErrSolve$ Number%
            Prints  possible  solution  to  error  number  Number%.    Used  by
            subroutine ErrScn.   Not  very extensive (to  save memory),  but it
            sure beats no error handling...




          ErrText$                                              ErrText$ Number%
            Prints text of error Number%.  Used by ErrScn.






































                                    ANGELIB for BC7/PDS                       23
                                    ___________________




          FKeys                                                      FKeys Keys$
            Displays a list of function keys at the bottom of the screen.

            Pass
            ____
                 Keys$       String of  keys  to be  displayed (e.g.,  "EPNQ").
                             Plus sign  (+) is  a reserved character.   If  the
                             first character  is a plus  sign followed by  two-
                             digits, then the keys are placed  starting on that
                             row.  For example, "+24EPNQ" would  place the keys
                             on row 24/25, instead of the default rows 23/24.

            Notes
            _____

            The file  FKEY.LST  is  seached  first  if it  is  in  the  current
            directory, then  an internal list is  searched if the  keys are not
            found.  The format of FKEY.LST ASCII file is:

                 KeyCode$,KeyName$,KeyDesc$,XPos%

            For example, a  line reading "C,Enter,Continue,51" would place  the
            key  "Enter" (in  reverse  video)  and the  description  "Continue"
            under  it at  column  51  whenever an  FKeys  "C"  is issued  in  a
            program.  See the sample FKEY.LST file.

            The routine scans the first screen row  at column 1 for the  colour
            to use.

            The keys "AacCFNoPQSsTtyn" are defined internally as follows:
                 A - Up and Down arrows
                 a - Up/Down/Right/Left arrows
                 C - Esc = Cancel
                 c - Enter = Continue
                 N - PgDn = Next
                 o - Enter = OK
                 P - PgUp = Prev
                 Q - Esc = Quit
                 S - Enter = Select
                 s - Esc = Stop
                 T - TAB = Next
                 t - BackTAB = Prev
                 y - Enter = Yes
                 n - Esc = No





















                                    ANGELIB for BC7/PDS                       24
                                    ___________________




          FmtFDD%                                                  Ok% = FmtFDD%
            Format floppy disks.

            Pass
            ____
                 Nothing

            Returns
            _______
                 TRUE if function completed
                 FALSE if cancelled

            Notes
            _____
                 It's easiest to give you an algorithm of the logic flow:

                 Search DOS PATH for WFF.EXE (What Floppy Format?)
                 If found, run it and exit
                 How many drives does this computer have?
                 If more than 1 present list
                 Issue DOS command "FORMAT d:" and exit

                 I always  put a  "Format Floppies" option  under my  File menu
                 which  simply  does  "i% =  FmtFDD".   See  also  FromFDD% and
                 ToFDD% functions.









































                                    ANGELIB for BC7/PDS                       25
                                    ___________________




          FontDL                          FontDL FontFile$, Pts%, Port%, FontNo%
            Downloads  a  soft  font file  to a  laser  printer and  displays a
            status window while doing so.

            Pass
            ____
                 FontFile$   The full  file name, including  drive and path  if
                             necessary,  of   the   soft   font  file   to   be
                             downloaded.

                 Port%       The port number (1-3) of the printer.

                 FontNo%     PCL font number  to assign this font (e.g.,  400).
                             Numbers  >128 are  generally best  to  use as  the
                             lower numbers have  standard fonts which typically
                             apply to them.

            Returns
            _______
                 Pts%        The  point size of  the font  is returned  in this
                             variable.

            Example
            _______
                 ok% = FontDL%(FontFile$, Pts%, Port%, FontNo%)
                 if ok% then
                     PRINT #PrintFile%, chr$(27)+"("+ltrim$(str$(FontNo%))+"X"
                     end if

            Notes
            _____
                 The above  sequence selects FontNo% as  the primary font  (the
                 '('  does  this).   To select  it  as the  secondary font  use
                 chr$(27)+"("+ltrim$(str$(FontNo%))+"X"

































                                    ANGELIB for BC7/PDS                       26
                                    ___________________




          FromFDD%                            ok% = FromFDD%(FileMask$, Method%)
            Presents a list of available floppy drives then  restores FileMask$
            files from floppy Drive$ using Method%.

            Pass
            ____
                 FileMask$   File  mask  to  include  in  restore  (e.g.,  *.*,
                             *.DAT, OLD??.*, etc.)

                 Method%     The method to use in restoring
                             1 = DOS Copy
                             2 = ARJ (req. a lot of free memory)
                             3 = LHARC
                             4 = PKZIP
                             Anything else = DOS Copy

            Returns
            _______
                 TRUE if completed, else FALSE




          GetDate                          GetDate d%, m%, y%, Intl%, Row%, Col%
            Accepts date from keyboard at {Row%,Col%}  unformatted (no symbols,
            just numbers  run together).   Extended keys  (arrows, PgUp,  etc.)
            will  exit  plus  a mouse  button  push  or  the  Alt  key.   Intl%
            determines the sequence of entry.

            Pass
            ____
                 d%          Default  day (1-31),  zero to  use to-day's  date,
                             negative to skip the day

                 m%          Default  month number, zero to  use current month,
                             negative to skip the month

                 y%          Default  year  number  (4  digits),  zero  to  use
                             current year, negative to skip the year

                 Intl%       Country  setting   (1=US,  2=Cdn,   3=US  &   Cdn,
                             4=Other)

                 Row%        Screen row on which to get input

                 Col%        Screen column in which to get input

            Returns
            _______
                 d%, m%, and y% are set to user's input

















                                    ANGELIB for BC7/PDS                       27
                                    ___________________




          GetFileName$     afile$ = GetFileName$(InOut%, ttl$, msg$, dflt$, ms%)
            Get  a file name  from user  in a  window, verify proper  format of
            entry, and check status of file.

            Pass
            ____
                 InOut%      Input or Output file?
                             1 =  Input file  (file must  exist; error  message
                             displayed if not) ('1' is for 'I'nput)
                             0 = Output file  (checks that file does not exist;
                             if file exists, presents a warning  that file will
                             be over-written) ('0' is for 'O'utput)

                 ttl$        Title of window

                 msg$        Help  message displayed  on the  screen below  the
                             file entry window

                 dflt$       Default response

                 ms%         Mouse flag (0=no mouse, non-zero=use mouse)
                             Mouse cursor should be invisible (off)

            Returns
            _______
                 Name of file, including drive and path (if entered)




          GetFontInfo                      GetFontInfo File$, FontName$, PtSize%
            Provides  name &  size in  the header  of a  soft font  file.   Try
            FontDL% on your laser for a demonstration of this.

            Pass
            ____
                 File$       The name  of the  soft font,  including drive  and
                             path, if necessary.

            Returns
            _______
                 FontName$   The  long  name of  the font  is returned  in this
                             variable, if present  (some fonts do not have  any
                             name in the header)

                 PtSize%     In  the font file's header  is a point size -- the
                             integer  value   of  this   is  returned  (decimal
                             chopped off).   Although this  should be the  real
                             point size, it's possible for it to be wrong.


















                                    ANGELIB for BC7/PDS                       28
                                    ___________________




          GetNum$       n$ = GetNum$(iRow%, iCol%, NumMask$, OrigNo$, ExitCode%)
            Get formatted  numerical input  from user.   Screen colours  at the
            specified  location will be inverted during input and restored upon
            exit.

            Pass
            ____
                 iRow%       Row at which to get input

                 iCol%       Left column at which to get input

                 NumMask$    Format  mask.   Valid  mask  characters  are pound
                             (#),  dollar ($),  and  comma  (,); all  else  are
                             literals (same  as PRINT  USING).  E.g.,  "#,###",
                             "$$##.##" or "(###) ###-####".

                 OrigNo$     Default number in string  form to avoid  numerical
                             data type conflicts.   Can be integer or  floating
                             point.

            Returns
            _______
                 User's  entry as  a string  (use VAL  to  extract it  into the
                 proper variable; for example, Cost@=VAL(A$) or Miles%=VAL(A$)

                 ExitCode%   ASCII value  of key user pressed  to exit.   E.g.,
                             Esc =  27.   If an extended  key (e.g.,  F4, PgUp,
                             etc.) is used ExitCode% is negative.

            Example
            _______
                 A$=GetNum$(15,30,"$$###.##",STR$(UnitPrice@),ExitCode%)

                 In  the  above  example  an input  field  will  be created  at
                 location (15,30).   The original  number, UnitPrice@, will  be
                 formatted and  displayed using the  mask "$$###.##", then  the
                 computer will  wait for the  user's input.   The key that  the
                 user  presses  to  exit  the field  will  be  returned in  the
                 variable ExitCode%.

                 See FKEYS.BI for key definitions.

























                                    ANGELIB for BC7/PDS                       29
                                    ___________________




          GetValidPath                       GetValidPath Drv$, path$, Msg$, ms%
            Displays  Msg$ then asks user for  a valid path name, defaulting to
            Drv$ and Path$.   If  path does  not exist  user is  asked if  s/he
            wants to create it.

            Pass
            ____
                 Drv$        Default drive (e.g., "C:")

                 Path$       Default path (e.g., "\TEST\DIR")

                 Msg$        Helpful message  to display on  the screen  (using
                             Inform%)

                 ms%         0=No mouse, 1=Use mouse

            Returns
            _______
                 Drv$        Selected drive letter followed by a colon

                 Path$       Selected path  with trailing  foreslash (\) (e.g.,
                             "\TEST\DIR\")

            Notes
            _____
                 The  mouse must be initialized and visible to use it.  To keep
                 things simple  & save  stack space, the  windows are  at fixed
                 positions (which also helps keep things consistent, too).






































                                    ANGELIB for BC7/PDS                       30
                                    ___________________




          GoodbyeScreen          GoodbyeScreen Pkg$, Reg%, FirstUse$, TimesUsed%
            Presents a  'goobye screen'  with which  I end  my programmes.   It
            also has  my name on it... :)   When you  register ANGELIB you will
            get a version which lets you put your copyright message on it.

            Pass
            ____
                 Pkg$        Package abbreviation  (e.g., "WVH",  "WML", etc.).
                             Should be a short name to fit properly in window.

                 Reg%        Registration   flag,  true/false,   controls   the
                             information displayed

                 FirstUse$   Date of  first use.   Used to  calculate number of
                             days package has been used.

                 TimesUsed%  Number of times package has been used.

            Returns
            _______
                 Nothing












































                                    ANGELIB for BC7/PDS                       31
                                    ___________________




          HelpIndex                                             HelpIndex Topic$
            Looks  on the disk  for a  file ending in  ".HLP" and uses  it as a
            help file.

            Pass
            ____
                 Topic$      A specific topic  to look up (as might be  desired
                             with context-sensitive help).   If blank  an index
                             is presented  in a scrollable menu.  Once the user
                             selects a topic, the help text  is displayed using
                             the Inform% function.

            Returns
            _______
                 Nothing.

            Notes
            _____

            The help file is an ASCII text file which is arranged like this:

            Topic #1+chr$(4)+Help information
              more information at least one space from left
              more help etc. etc.
            Topic #2+chr$(4)+Help info...

            Help files may contain up to 100  topics.  The total length  of the
            help text for a single entry is limited to 99  lines with a maximum
            of  50 characters per line (roughly 4k of text).  Topics MUST begin
            in column  one, additional  text MUST begin  AFTER column  1 (i.e.,
            indent the help text at least one space).

            The topic  may begin with a chr$(1)  through chr$(3) to indicate an
            outline   level.     For  example,   you   might  have   FILE  then
            chr$(1)+Open.































                                    ANGELIB for BC7/PDS                       32
                                    ___________________




          Inform%    ok% = Inform%(iRow%, iCol%, iWid%, iType%, ms%, snd%, Msg$)
            Displays a scrollable information window containing up to  99 lines
            of information.   Msg$ may be any  length.  The routine will  break
            the message  into lines of  iWid% length  or less.   If the box  is
            positioned too low on the screen, it will be adjusted upwards.

            Pass
            ____
                 iRow%       Top row of window
                 iCol%       Left column of window
                 iWid%       Window width (in characters)

                 iType%      Determines buttons (see below)
                             0="Message" (no buttons)
                             1="Note" (Ok button)
                             2="Caution" (Ok/Cancel)
                             3="Warning" (blinking) (Continue/Stop)
                             4="Attention" (blinking) (Yes/No)

                 ms%         Mouse support
                             0 = No mouse
                             1 = Mouse available
                             99 = Reset mouse & use it, if available

                 snd%        Sound: 0=None 1=Squeak 2=Tick 3=Beep
                 Msg$        Message  to  display  in  the  window.    Will  be
                             truncated at 99 lines, if necessary.

            Returns
            _______
                 TRUE if user presses ENTER to exit
                 FALSE if user presses ESC to exit

            Notes
            _____

            All message  types except  zero restore  the screen on  exit.   Use
            iType%=0  when you want to put  information on the screen and leave
            it there, such as instructions on how to enter data.

            The mouse should be turned OFF before calling Inform%

            Custom Titles
            _____________

            A custom title  can replace the default.   Just place a title  plus
            chr$(254) at  the start  of your message  (changed from  chr$(4) to
            allow the code to be imbedded without the use of the CHR$ function



















                                    ANGELIB for BC7/PDS                       33
                                    ___________________




          InformFill      InformFill iRow%, iCol%, BegLine%, WinSize%, MLines$()
            Used by Inform% -- fills the window with text.




          InputDate       InputDate MonthNo%, Day%, Year%, Row%, Col%, ExitCode%
            Gets  a VALID  date  from  the keyboard  at  Row% and  Col% on  the
            screen.  Unlike  the GetDate routine,  InputDate only  supports the
            DD/MM/YYYY format and does not  check for a mouse button or the Alt
            key being pressed.

            Pass
            ____
                 MonthNo%    Month number (1-12)
                             Zero for current month
                             -1 to skip month

                 Day%        Day number (1-31)
                             Zero for current day
                             -1 to skip day

                 Year%       Year number (4 digits)
                             Zero for current year
                             -1 to skip year

            Returns
            _______
                 ExitCode%   Set to the key used to exit.

            Example
            _______
                 M%=0: D%=0: Y%=0
                 InputDate M%, D%, Y%, 10, 20, ExitCode%

                 This will  get the  date at location (10,20)  using the system
                 clock's current date as default.

            Example
            _______
                 M%=0: D%=-1: Y%=0
                 InputDate M%, D%, Y%, 10, 20, ExitCode%

                 This will get a month  and year at location (10,20) using  the
                 system clock's current month & year as default.






















                                    ANGELIB for BC7/PDS                       34
                                    ___________________




          IsColour%                                               x% = IsColour%
            Get adapter card type.

            Pass
            ____
                 Nothing

            Returns
            _______
                 True (-1) if colour adapter card, otherwise False (0).




          IsPath%                                     stat% = IsPath%(Pathname$)
            Checks validity of  Pathname$, extends Pathname$ if necessary,  and
            checks if the  path exists.  Can  create a directory at the  user's
            option.  This function is called by GetValidPath.

            Pass
            ____
                 TheName$    Path name in the format [d:][\path\]
                             If the drive or full path are missing  the current
                             drive/path are inserted

            Returns
            _______
                 0 = Path not found/not created (suitable for _O_utput)
                 1 = Path exists (suitable for _I_nput)
                 -1 = Bad path specification, or -2 = Other error

                 TheName$    Contains the  fully extended  path name  including
                             the drive  letter unless user  hit Esc when  asked
                             permission to create the directory.

            Example
            _______
            Assume the current path is C:\ugh\ and no directories under it.

                 Path$ = "test"
                 stat% = IsPath%(Path$)
                 select case stat%
                      case 0    'Path not found & not created (user hit Esc)
                      case 1    'Path found, everything okay
                      case is < 0  'Bad path specification or DOS error

            Inform user that C:\ugh\test\  does not exist & ask to create.   If
            "No" stat%=0 & Path$="test", else stat%=1 & Path$="C:\ugh\test\"




















                                    ANGELIB for BC7/PDS                       35
                                    ___________________




          Max%                                           Highest% = Max%(A%, B%)
            Returns the larger of the two integers




          MaxL&                                         Highest& = MaxL&(A&, B&)
            Returns the larger of two long integers.




          MaxS!                                         Highest! = MaxS!(A!, B!)
            Returns the larger of two single-precision floating point numbers.




          Min%                                            Lowest% = Min%(A%, B%)
            Returns the smaller of two integers.




          MinL&                                          Lowest& = MinL&(A&, B&)
            Returns the smaller of two long integers.




          MinS!                                          Lowest! = MinS!(A!, B!)
            Returns the smaller of two single precision numbers.































                                    ANGELIB for BC7/PDS                       36
                                    ___________________




          MonthDays%                                NoDays% = MonthDays%(M%, Y%)
            Returns the number of days in month M% of year Y%.

            Pass
            ____
                 M%          Month (1-12)
                 Y%          Year (2 or 4 digits)

            Returns
            _______
                 Number of days in the specified month

            Example
            _______
                 MonthDays%(2,1992) returns 29




          OutDev$                                    PDev$ = OutDev$(Port%, ms%)
            Presents a menu of output devices: Screen, Printer, and Disk  File.
            If Disk  File is  selected the  user is  prompted for  a file  name
            (using  GetFileName$).   If Printer is selected  the routine checks
            if the printer is on-line (that's  partly why Port% is needed)  and
            returns the device  name as  "LPT1:", "LPT2:",  or "LPT3:"  (that's
            also why Port% is needed).

            Pass
            ____
                 Port%       Port number of printer (1, 2, or 3)

                 ms%         Mouse support:  0=no, non-zero=yes

            Returns
            _______
                 Device or file name
































                                    ANGELIB for BC7/PDS                       37
                                    ___________________




          ParseExit%                ExitCode% = ParseExit%(ExitKey$, Row%, Col%)
            Checks  ExitKey$  for  ASCII  character,  scan  code,  or  embedded
            Row:Col (such as from EZ-Windows GetField routine).

            Pass
            ____
                 ExitKey$    ASCII  character or  scan code,  just like  INKEY$
                             would  return,  plus  it  can  be  in  the  format
                             "RR:CC"  to  indicate   a  mouse  click  at   that
                             location.

            Returns
            _______
                 Row%        Set to row  number of mouse click, if  applicable,
                             else zero

                 Col%        Set to column of mouse click,  if applicable, else
                             zero




          ParseFSpec             ParseFSpec TheName$, Drv$, Pathname$, TheName2$
            Searches file name for the drive, path, and NAME.EXT components.

            Pass
            ____
                 TheName$    Full file name to parse

            Returns
            _______
                 Drv$        Drive letter followed by a colon (if present)

                 Pathname$   Path name, beginning and  ending with a  foreslash
                             (\), if present

                 TheName2$   FILENAME.EXT, if present

            Notes
            _____

            Converts the regular  slash (/) to  a foreslash  (\), in case  user
            enters the wrong one.

            If  an invalid file  name is entered (for  example, more than eight
            characters  in  the  name  or more  than  three  characters in  the
            extension) then TheName2$ is returned as a blank string.

            The original  file name, TheName$, is not changed  so that if there
            is an error it can be given to the user for editing again.


















                                    ANGELIB for BC7/PDS                       38
                                    ___________________




          PctDone                                       PctDone Percent%, title$
            Displays a  graph of  percentage completion in  a small box  on the
            screen. If  the process  takes longer than 20  seconds a count-down
            timer will appear below the graph.

            Pass
            ____
                 Percent%    Percentage to  draw on the  graph.  The first time
                             PctDone is called a  small window is  drawn.  When
                             Percent% is 100 the window is erased.

                 title$      A  short title (10  chars max) to display over the
                             progress bar.

            Returns
            _______
                 Nothing

            Notes
            _____

            You must  call PctDone with  100 to clear it  or the  next time you
            call it it will think the window is still on the screen...

            Example
            _______
                 For Sort%=0 to Y%
                     if 100 * Sort% \ Y% < 100 then
                         PctDone(100 * Sort% \ Y%,"Sorting")
                         endif
                     do something...
                     next Sort%
                 PctDone 100,""    'Close the window/reset the routine




          PrintRptMsg                                           PrintRptMsg Msg$
            Displays a window saying  "Printing "+Rpt$+" Press  Esc to cancel."
            I use this on every report so I made it into a routine.

            Example
            _______
                 Rpt$ = "Stock Status Report"
                 PrintRptMsg Rpt$























                                    ANGELIB for BC7/PDS                       39
                                    ___________________




          PtrReady%                                       ok% = PtrReady%(Port%)
            Checks if printer on LPT[Port%] is on-line.

            Pass
            ____
                 Port%       Printer port (1, 2, or 3)

            Returns
            _______
                 TRUE if ready, FALSE if not

            Notes
            _____
                 It doesn't matter whether or not you  have opened a channel to
                 the printer before calling this routine.




          QSort    QSort Wrk%(), Arr1$(), Arr2$(), NoDims%, NoItems%, SortField%
            A good public domain sorting  method.  Used by ChooseFile$ to  sort
            the file list.

            See  the source code in QSORT.SUB.  This is  not my code -- I'm not
            selling it, I just use it and pass it on to you...




          Repl$                                cmd$ = Repl$(St$, Target$, Item$)
            Replaces occurence of  Target$ in St$ with  Item$.  Good for  laser
            printer codes.

            Pass
            ____
                 St$         Complete string

                 Target$     The part of St$ to be replaced

                 Item$       The replacement for Target$

            Returns
            _______
                 The modified string with trailing spaces & nulls truncated.

            Example
            _______
                 Repl$("&a#V ","#","500") will return "&a500V"





















                                    ANGELIB for BC7/PDS                       40
                                    ___________________




          SayOk                                            SayOk Row%, Col%, ms%
            Puts an  "Ok" button centred  at position {Row%, Col%}  and puts an
            "Enter / Continue" message  at the bottom of the screen.   Mouse or
            keyboard can be used to exit.

            Pass
            ____
                 Row%        Row on which to place button
                 Col%        Middle of button
                 ms%         Use mouse support? (True/False)

            Returns
            _______
                 Nothing

            Notes
            _____
                 Scans screen at  {Row%-1, Col%} and inverts the colours  found
            there -- the idea  being to make the button stand out from the lines
            above it.
                 If  ms% is non-zero (True)  then the mouse must be initialized
            but invisible.




          SearchPath$                                a$ = SearchPath$(FileName$)
            Searches the DOS PATH environment variable for a file.

            Pass
            ____
                 FileName$   Name of file for which to search  (file name only;
                             no drive or path)

            Returns
            _______
                 If file is found, DOS path with trailing foreslash (\)
                 If file is not found, returns blank string ("")

            Example
            _______
                 Assuming you have C:\ in your search path...

                 A$ = SearchPath$("Config.sys")

                 will set A$ = "C:\"























                                    ANGELIB for BC7/PDS                       41
                                    ___________________




          SelectFont%          ok% = SelectFont%(m$,PtrNo%,Pts%,Ext$,SFdir$,ms%)
            Displays  a scrollable list of soft fonts in a window and waits for
            user to select  one or press Esc.   List  will show DOS file  name,
            font  name (if present  in header)  and point  size (if  present in
            header).

            Pass
            ____
                 m$          Purpose  of  font,  displayed  at  top  of  window
                             (e.g., "Printing", "Reports", "Titles", etc.)

                 PtrNo%      The printer's record number in PRINTER.DAT

                 Ext$        Soft  font   file  extension   (e.g.,  "SFP"   for
                             portrait fonts, "SFL" for landscape fonts)

                 SFdir$      Default soft font directory (e.g., "C:\Fonts")

                 ms%         Mouse support:  0=no mouse, 1=use mouse

            Returns
            _______
                 Function returns font's  record number in PRINTER.DAT or  zero
                 if user presses Esc

                 m$          Changed  to soft  font file  name (including path)
                             if soft font selected

                 Pts%        Changed to point size if scalable font

                 SFdir$      Soft font directory with any user modifications

            Notes
            _____
                 Mouse must be initialized but turned OFF































                                    ANGELIB for BC7/PDS                       42
                                    ___________________




          SelectFontSize%             Pts% = SelectFontSize%(Font$, IsPts%, ms%)
            This routine  gets the  user's choice  for font  size in a  window.
            This routine  is called  whenever a  scalable font  is selected  in
            SelectFont% (I don't ever use this routine directly).

            Pass
            ____
                 Font$       The font  name  (for  displaying on  the  screen).
                             For example, CG Times.

                 IsPts%      Logical  flag  to indicate  whether point  size is
                             needed  (versus   character  pitch).     If   true
                             "points"  is   displayed;   otherwise  (if   zero)
                             "character pitch" is displayed on screen.

                 ms%         Mouse flag: 0=no mouse, 1=use mouse

            Returns
            _______
                 Font size (integer) or zero if user presses Esc.

            Notes
            _____
                 This  routine  is  called  by  SelectFont%.    Mouse  must  be
            initialized but turned OFF (invisible cursor).




          SelectSoftFont$              Font$ = SelectSoftFont$(Path$, Ext$, ms%)
            This routine presents a scrollable list of soft fonts  in a window.
            It  is called by  SelectFont% if  the user selects  a soft font (as
            opposed to a font built into the printer).

            Pass
            ____
                 Path$       Path to soft fonts

                 Ext$        Extension to be included in the  list (e.g., "SFP"
                             for portrait fonts)

                 ms%         Mouse support (0=no, 1=yes)

            Returns
            _______
                 Name of chosen font, including drive & path, if necessary.

                 Path$       Path as modified by user




















                                    ANGELIB for BC7/PDS                       43
                                    ___________________




          StrFmt$                            ph$ = StrFmt$(St$, Mask$, reverse%)
            Formats  a string according to a  given mask.  I use this to format
            phone numbers, zip codes, etc.

            Pass
            ____
                 St$         String to format
                 Mask$       Mask
                 reverse%    Flag: if  TRUE formatting  is done  from right  to
                             left; if  FALSE (0) formatting  is done from  left
                             to right. TRUE is the most common setting.

            Returns
            _______
                 Formatted string

            Examples
            ________
                 a$ = StrFmt$("8052662574","(###) ###-####",-1)
                 returns a$ = "(805) 266-2574"

                 a$ = StrFmt$("2726893","(###) ###-####",-1)
                 returns a$ = "(   ) 272-6893"

                 a$ = StrFmt$("93551","#####-####",0)
                 returns a$ = "93551-    "




          StripSymbols$                               new$ = StripSymbols$(Old$)
            This  strips any symbols  from a string  of numbers.   I use  it to
            strip  the parenthesis, etc. from  phone numbers, etc.  Returns the
            string St$ stripped of its parenthesis, dashes, and commas.

            Example
            _______
                 a$ = StripSymbols$("(805) 272-4923")

                 returns a$ = "8052724923"



























                                    ANGELIB for BC7/PDS                       44
                                    ___________________




          ToFDD%                                     ToFDD% (FileMask$, Method%)
            Presents  a  list  of available  floppy  drives (if  more  than one
            available) then backs-up FileMask$ to drive Drive$ using Method%.

            Pass
            ____
                 FileMask$   File  mask  to  include  in  restore  (e.g.,  *.*,
                             *.DAT, OLD??.*, etc.)

                 Method%     The method to use in making the back-up
                             1 = DOS Copy
                             2 = ARJ (req. a lot of free memory)
                             3 = LHARC
                             4 = PKZIP
                             Anything else = DOS Copy

            Returns
            _______
                 TRUE if completed
                 FALSE if aborted




          Trim$                                                   b$ = Trim$(a$)
            Trims  leading &  trailing  spaces and  trailing chr$(0)'s  from  a
            string  (using LTRIM$/RTRIM$ will remove  spaces but not nulls).  I
            use this to  test the length  of static  strings, which are  padded
            with CHR$(0)'s.




































                                    ANGELIB for BC7/PDS                       45
                                    ___________________




          ZipFmt$                                   a$ = ZipFmt$(TheZip$, Intl%)
            Formats a zip code according to Intl% flag.

            Pass
            ____
                 TheZip$     Unformatted Zip/Postal code

                 Intl%       Country setting
                             1 = USA
                             2 = Canada
                             3 = USA and Canada
                             4 = All others (no formatting)

            Returns
            _______
                 Formatted zip
                             USA -- #####-####
                             Canada -- A#A #A#
                             Other -- No formatting done




          zTrim$                                                 b$ = zTrim$(a$)
            This  routine only trims trailing nulls [chr$(0)]  from the string.
            Good for  trimming fixed-length file fields  which are padded  with
            nulls when  you don't want to remove any spaces [chr$(32)] from the
            string.





































                                    ANGELIB for BC7/PDS                       46
                                    ___________________




          XII. USING PRINTER FUNCTIONS

               In order to use the printer functions, you will need to include
          the data structures definition file PtrRec.DEF in your source code. 
          Place the line "'$INCLUDE: 'PtrRec.DEF'" near the beginning of your
          code.

               Next, you will need to dimension the variables to hold the
          records.  I often do this at the routine level rather than declaring
          global (common) variables, but either way will work fine unless your
          programme is strapped for memory one way or the other.  At the routine
          level just DIMension; to make the variables global use DIM SHARED. 
          The record types are:

               LaserPtrRec - Control codes which are not font-specific
               LaserFontRec - Font-specific control codes
               DMPtrRec - Dot matrix codes which are not font-specific
               DMFontRec - Font-specific dot matrix control codes

               The records are all the same length so that the single file,
          PRINTER.DAT, can contain all four record types.  Laser printer records
          start with a greater-than (>) sign (for example, ">Panasonic KX-
          P4450").  Dot matrix printer records start with a dot (for example,
          ".NEC P5300").  Both record types (dot matrix and laser) begin with a
          Model field, so you can use a LaserPtrRec variable to read a dot
          matrix record, then, if the Model begins with a period, re-read the
          record as a DMPtrRec variable.  To illustrate:

          DIM Lz as LaserPtrRec
          DIM DM as DMPtrRec
          PtrFile% = FREEFILE
          OPEN "Printer.DAT" FOR RANDOM ACCESS READ AS PtrFile% LEN = LEN(Lz)
          GET #PtrFile%, PtrRec%, Lz
          IF LEFT$(Lz.Model, 1) = "." THEN
               GET #PtrFile%, PtrRec%, DM
               END IF

               You need to use this information whenever printing a report in
          your application.  Use the ChoosePtr% function to get and save the
          user's choice for a printer and use SelectFont% to get the user's font
          choice(s).  This information can be saved in a configuration file. 
          Then, before printing, use the above routine to get the printer
          control codes (such as reset, bold, underline, etc.) followed by a
          routine like the example below to get the font control codes (such as
          select) and information such as its size and spacing.


















                                    ANGELIB for BC7/PDS                       47
                                    ___________________




               Much like the above example, here is how to read a font record:

          DIM LF as LaserFontRec
          DIM DF as DMFontRec
          ' Normally you would already have PtrFile% open from the above
          ' routine (to read the printer codes).  If not, you would need
          ' to open the file as in the above routine.
          m$ = "Reports": Ext$ = "SFP"                     'Portrait fonts (SFP)
          FontRec%=SelectFont%(m$, PtrRec%, Pts%, Ext$, SFdir$, ms%)
          SELECT CASE FontRec%                                     'Check result
               CASE 0                                       'User hit Escape key
                 EXIT SUB
               CASE -1                                     'User chose soft font
                 PRINT #PrintFile%, zTrim$(Lz.Init);                'Reset laser
                 Done% = FontDL(SFont$, FPts%, PtrPort%, 400)     'Download font
                 IF NOT Done% THEN
                             'User aborted download; flag routine as 'cancelled'
                   EXIT FUNCTION or SUB
                   END IF
                 IF FPts% > 0 THEN                           'FontDL got a size?
                     Fcpi% = 120 \ FPts%      'Cvt points to rough CPI for calcs
                   ELSE                                     'No size in font hdr
                     Fcpi% = 10                     'Assume 12pt/10cpi for calcs
                   END IF
                 PRINT #PrintFile%, CHR$(27); ")400X";       'Secondary, ID #400
               CASE ELSE
                 IF Ptr$ = "D" THEN                          'DOT MATRIX PRINTER
                     GET #PtrFile%, FontRec%, DF
                     PRINT #PrintFile%, zTrim$(DM.Init);                  'Reset
                     PRINT #PrintFile%, zTrim$(DF.Select);          'Select font
                     T$=Trim$(DM.HTab) + CHR$(2 * Fcpi) + CHR$(0)  'Set tab @ 2"

                   ELSE                                           'LASER PRINTER
                     GET #PtrFile%, FontRec%, LF
                     PRINT #PrintFile%, zTrim$(LF.SymSet2);      'Make secondary
                     PRINT #PrintFile%, zTrim$(LF.Select2);     'Use SymSet1 etc
                     PRINT #PrintFile%, zTrim$(LF.Spacing);     'to make Primary
                     IF VAL(LF.Pitch) = 0 THEN                   'Scalable font?
                       PRINT #PrintFile%,LTRIM$(STR$(Pts%));         'Point size
                       END IF                                '(from SelectFont%)
                     PRINT #PrintFile%, zTrim$(LF.Pitch);      'Pitch select cmd
                     PRINT #PrintFile%, zTrim$(LF.Slant);        'Upright/italic
                     PRINT #PrintFile%, zTrim$(LF.Weight);       'Light/Med/Bold
                     PRINT #PrintFile%, zTrim$(LF.Number);      'PCL font number
                     IF RIGHT$(zTrim$(LF.Pitch), 1) = "h" THEN     'Mono-spaced?
                         Fcpi% = VAL(LF.Pitch)                        'Store cpi
                         FPts% = 120 \ temp1%       'Cvt cpi to rough pts if nec
                       ELSE
                         FPts% = VAL(LF.Pitch)                     'Store points














                                    ANGELIB for BC7/PDS                       48
                                    ___________________




                         Fcpi% = 120 \ TPts%        'Cvt pts to rough cpi if nec
                       END IF
                   END IF
               END SELECT
          CLOSE #PtrFile%

               Now you have the printer ready to go and you have the variables
          Fcpi% and Fpts% to work with in calculating TAB locations, line
          length, etc.

               You will notice that I use zTrim$() rather than just printing a
          variable.  This is because BASIC pads TYPE fields with nulls -
          CHR$(0)'s.  The zTrim$() function removes CHR$(0)'s but leaves
          trailing spaces (which may be part of the command string).

               There are some things that you must know, such as that the PCL
          pitch ends in "h" if it is mono-spaced (cpi) and "v" if it is
          proportionally-spaced (points).  Also, in setting a TAB string in the
          above example I used the Epson-standard which terminates the setting
          of TABs with a CHR$(0).  This is the best solution I have come up
          with, and every printer I've seen in the past five years uses Epson
          codes anyhow, so I figure this technique will work 90% of the time or
          better.

               You can make your own PRINTER.DAT file or modify the one supplied
          just by using the PtrRec.DEF file.  Someday soon I will make a
          programme for modifying the PRINTER.DAT file, but for now it will have
          to be done manually.  I would really appreciate it if you would share
          with me any new printers you install by sending me your modified
          PRINTER.DAT file.
































