ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. CONTENTS CONTENTS I. DISCLAIMER OF WARRANTY . . . . . . . . . . . . . . . . . . 1 II. LICENSE . . . . . . . . . . . . . . . . . . . . . . . . . . 1 III. TECHNICAL SUPPORT (HOW TO REACH ME) . . . . . . . . . . . . 1 IV. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . 2 V. REGISTRATION . . . . . . . . . . . . . . . . . . . . . . . 2 A. The Six Benefits of Registration . . . . . . . . . . . . 2 B. How Much Does Such a Priceless Gem Cost? . . . . . . . . 3 C. How to Get a FREE Registered Edition . . . . . . . . . . 3 VI. SYSTEM REQUIREMENTS . . . . . . . . . . . . . . . . . . . . 6 VII. FILES WHICH MAKE UP ANGELIB . . . . . . . . . . . . . . . . 6 VIII. USING ANGELIB . . . . . . . . . . . . . . . . . . . . . . . 6 IX. REFERENCE . . . . . . . . . . . . . . . . . . . . . . . . . 7 -i- -i- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. I. DISCLAIMER OF WARRANTY I. DISCLAIMER OF WARRANTY THIS SOFTWARE PROGRAM AND DOCUMENTATION ("ANGELIB") IS PROVIDED "AS IS" WITHOUT WARRANTIES OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THOSE CONCERNING MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. BY USING ANGELIB, YOU ARE EXPRESSLY RELEASING ANGEL BABUDRO FROM ANY LIABILITY RESULTING FROM THE USE OF THIS SOFTWARE AND DOCUMENTATION. YOU MUST ASSUME THE ENTIRE RISK OF USING ANGELIB. YOU ARE ADVISED TO TEST AND SUPERVISE ANGELIB THOROUGHLY BEFORE RELYING ON IT. II. LICENSE II. LICENSE 1. ANGELIB is being distributed as Shareware. This library is not free. ANGELIB is licensed for individual personal use and evaluation for an unlimited time. Use and evaluation by businesses, corporations or individuals in a commercial venture is limited to 60 days, after which time the REGISTERED edition of ANGELIB must be purchased or the use of unregistered edition of ANGELIB must be discontinued. 2. You may keep as many backup copies of ANGELIB as you wish, but you may not use ANGELIB simultaneously on more than one computer. Additionally, you are granted the right to share ANGELIB with others, as long as you distribute the ANGELIB archive exactly as you received it, with all associated files included. REGISTERED USERS MAY NOT DISTRIBUTE THE SEPARATE 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. You may only recoup your cost of such distribution, not to exceed US$6 (six dollars). III. TECHNICAL SUPPORT (HOW TO REACH ME) III. TECHNICAL SUPPORT (HOW TO REACH ME) Thanks for trying my software. Please throw your comments, suggestions, criticisms, etc. my way. 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. -1- -1- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. 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 BBS Angelo Babudro West Coast The Researcher's BBS, Southern CA (805) 949-8151 USR HST DS East Coast Nite Air BBS, Central NY (315) 339-8831 USR HST 14.4 Odie's PCBoard, Central NY (315) 339-6713 USR HST DS IV. INTRODUCTION IV. INTRODUCTION ANGEL.QLB is a BC7 library for developing business applications, especially data base uses. These are the routines I use in developing my apps along with a couple of other shareware libraries, most notably John Strong's EZ-Windows (it's terrific; buy it). I put in the things that are simple in logic, but a pain to code, like doing a "percent completed" bar graph in a window. It's the same routine over and over... so it becomes part of the library. Well, what more can I say? Check out the routine reference that follows. Hope you like it. Hope you register it. Bye... V. REGISTRATION V. REGISTRATION Registration entitles you to many benefits. You will get the latest version of the library with .LIB and .QLB, individual OBJ modules so you can construct your own libraries, and some extra routines. A. The Six Benefits of Registration A. The Six Benefits of Registration 1. You will be getting a library that would likely take a long time to develop yourself 2. The author will really be glad you registered and will think good thoughts about you. 3. My 3-month-old son handles all the tech support calls ;), but for everything else you will have a real person who is real person 100% knowledgeable about the software whom you can contact with suggestions, comments, questions, problems, etc. -2- -2- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. 4. You'll have that warm feeling of having helped one of the "little guys" -- someone who isn't a huge corporation. 5. You will have helped to keep shareware alive, that great concept that lets you try out software before buying it. before 6. That nagging, "Did I do the right thing?" feeling will go away. B. How Much Does Such a Priceless Gem Cost? B. How Much Does Such a Priceless Gem Cost? Single Copy -- A single copy costs $15 in U.S. or Canadian Single Copy funds; I wish there weren't any exchange rate, so I'm willing to forget that there is one... 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) formats. You will also receive notification of updates. At the time of this writing, updates are $5 from any version. See below for printed manuals. Multiple Copies -- If you have more than one programmer in Multiple Copies your company who wants to use ANGELIB, etc. please send: - Qty. 2-4 $10.50/disk - Qty. 5-9 $9.00/disk - Qty. 10 or more $8.00/disk Site License -- purchase one copy of ANGELIB and use it on as Site License many computers as necessary at a single location of a single single location of a single business. business - Up to 4 computers $30.00 - Up to 20 computers $90.00 - Any number of computers $200.00 Manuals -- I will print the latest revision of the manual you Manuals are reading right now on 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 the binder... - One copy $8.00 - Two or more copies $5.00 per copy C. How to Get a FREE Registered Edition C. How to Get a FREE Registered Edition My Shareware career is just getting started, and I know I need some help from all of you BBS users to be successful. So if you'll help me in one of the following ways I will send you a free registered copy: -3- -3- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. 1. Write a review of one of my packages and post it on a bulletin board. Send me a copy of the review with the BBS's header on it and the name and phone number of the BBS. Just give me your honest criticism and praise in a good review (not a one-liner), and I'll send you a registered copy. 2. If you upload a package to at least five BBS's, send me the names and phone numbers of the BBSs you uploaded to and I'll send you a registered copy. Please be honest, folks; I want your help, but this costs me money, after all... 3. If you have an idea that would make my software better please send it to me. If I use your idea I will send you a registered copy with your idea in it. These offers subject to withdrawal or change at any time These offers subject to withdrawal or change at any time without notices. Prices are subject to change without notice. without notices. Prices are subject to change without notice. Bulletin Board Sysops please see the file SYSOP.DOC for special pricing and information. Angel Babudro 28 Mulberry Stree Clinton, NY 13323-1506 (315) 853-1070 Please register the software you keep. Please register the software you keep. -4- -4- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. ANGELIB REGISTRATION/ORDER FORM ANGELIB REGISTRATION/ORDER FORM Your Name______________________________________________________ Company Name___________________________________________________ Address________________________________________________________ _______________________________________________________________ City_________________________ State/Prov_____ Zip code_________ Where did you get your unregistered copy?______________________ Single copy Latest version on disk - just $15 _______ Single copy Multiple 2-4 copies Qty _____ x $10.50 each Multiple copies 5-9 copies Qty _____ x $ 9.00 each copies 9 or more Qty _____ x $ 8.00 each _______ Site Up to 4 computers -- $30 Site License Up to 20 computers -- $90 License Any number of computers -- $200 _______ Printed One copy is $8 Printed Manuals 2 or more Qty _____ x $5 each _______ Manuals Shipping & Please add $2 $2.00 Shipping & _______ Expenses For 8" disks add $3 extra _______ Expenses Shipping to Canada add $5 extra _______ ** T O T A L ** _______ ** T O T A L ** Disk size & quantity ___3«" ___5¬" ___8" Drive density ___Low density req'd ___High density okay All prices are in U.S. or Canadian dollars. Please contact me for orders to other countries. Orders to New York State please add sales tax for your area. Mail this page with your cash (use Registered mail), cheque or money order to Angel Babudro, 28 Mulberry Street, Clinton, NY 13323- 1506. Thank you! -5- -5- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. VI. SYSTEM REQUIREMENTS VI. SYSTEM REQUIREMENTS All you need is PC/MS-DOS 3.3 or later, PDS/BC 7.1, and a computer. You will need about 200k of disk space for the files. VII. FILES WHICH MAKE UP ANGELIB VII. 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) 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 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 VIII. USING ANGELIB VIII. 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'). When you start up QBX just '$INCLUDE: 'Angel.bi' put "/L d:\path\ANGEL" -- this will load the quick library into memory so you can run the routines. 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. Rather than write some lame demonstration programme to show off ANGELIB's features, I would like to suggest that you check out my shareware which has been developed using this library: What Mailing -6- -6- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. List? (WML), What Vehicle History? (WVH), What Job Summary? (WJS), What Floppy Format? (WFF), and What Tape Back-up (WTB). IX. REFERENCE IX. REFERENCE Functions are called in the way any other function is -- var = Function(param1,param2,etc). For example, if you want to _________________________________ calculate the attribute number for a blue background and a bright white foreground and put it in the variable attr% you would say "attr% = CalcAttr%(15,1)". Subroutines do not pass back a single value, but they very often modify one or more variables which are passed to them. DBFHeader is a good example of this. When you include ANGEL.BI in your programme you can call the subroutines without the "CALL" statement. For example, to pause for a copyright message you would put "Delay 5.5" to pause 5.5 seconds. The routines below each show their name at the left margin, a sample calling sequence aligned with the right margin, definition of variables, and finally an english explanation of the routine's purpose. BackupMethod% Ok% = BackupMethod%(default%, ms%) BackupMethod% Presents a menu of back-up methods, highlighting the default% entry. Pass Pass ____ default% Default (current) back-up method. This is the seed for the menu. 1 = DOS Copy 2 = ARJ 3 = LHARC 4 = PKZIP ms% Mouse support flag 0=no 1=yes Returns Returns _______ TRUE (-1) if operation completed or FALSE if user cancels -7- -7- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. CalcAttr% attr% = CalcAttr% (Fore%, Back%) CalcAttr% Ror use with routines that need a single integer colour code. Pass Pass ____ Fore% Foreground colour code Back% Background colour code Returns Returns _______ Fore% + (Back% * 16) ChooseCountry% Intl% = ChooseCountry%(default%, ms%) ChooseCountry% Presents a pop-up menu of four country choices. Pass 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 Returns _______ Menu item selected (1-4), or zero if user presses Esc -8- -8- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. ChooseFD$ fdd$ = ChooseFD$ 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 Pass ____ Nothing Returns Returns _______ Floppy disk drive letter followed by a colon, or a blank string if user presses Esc. ChooseFile$ TheFile$ = ChooseFile$ (FileSpec$, Exclude$) ChooseFile$ Presents a scrollabel list of files in a window which match FileSpec$ (excluding Exclude$) and waits for user to choose one. Pass Pass ____ FileSpec$ 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 exclude (e.g., "*.bak"). Do not put a drive or path in not this. Returns Returns _______ File name chosen without drive or path, or null string ("") _______ if user presses Esc -9- -9- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. ChoosePort% PtrPort% = ChoosePort% (default%, ms%) ChoosePort% Presents a pop-up menu of printer ports (LPT1, LPT2, and LPT3) and waits for user to pick one or press Esc. Pass Pass ____ default% Default (current) printer port setting (1-3). ms% Mouse support available: 0 = No, 1 = Yes Returns Returns _______ Port number (1-3) or zero if user presses Esc ChoosePtr% Ok% = ChoosePtr% (iType$, PtrNo%, PtrPort%, ms%) ChoosePtr% Presents a pop-up menu of up to 15 printer choices from the PRINTER.DAT file, with the default (PtrNo%) highlighted. Pass Pass ____ iType$ Indicates the type of printers 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 Returns _______ 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 -10- -10- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. ContCan% i% = ContCan% ContCan% Displays "Continue" and "Cancel" keys at the bottom of the screen and waits for response. Pass Pass ____ Nothing Returns Returns _______ TRUE (-1) if user presses Esc FALSE (0) if user presses Return (aka Enter) DateFmt$ FormattedDate$ = DateFmt$(d%, m%, y%, intl%) DateFmt$ 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 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 Returns _______ Formatted date -11- -11- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. DateVal% dv% = DateVal%(TheDate$) DateVal% 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 Pass ____ TheDate$ Date string formatted the same as BASIC's DATE$ function Returns Returns _______ Integer value based on the date DBFHeader DBFHeader fname$, Field$(), reclen%, recs&, NoFields% DBFHeader 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 Pass ____ fname$ The DBF file name, including drive and path, if necessary Field$() 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 Returns _______ Field$() 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 NoFields% The number of fields -12- -12- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. DBFPickFld% fld% = DBFPickFld%(iRow%, iCol%, field$()) DBFPickFld% 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 Delay Delay Sec! Delay Delays for Sec! seconds. I use this for copyright messages, etc. Pass Pass ____ Sec! Number of seconds to delay (floating point) Returns Returns _______ Nothing DrawFDD DrawFDD Light%, iRow%, iCol% DrawFDD 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 Pass ____ Light% True if drive "light" is to blink, false if not iRow% Top row of picture iCol% Left column of picture Returns Returns _______ Nothing -13- -13- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. DrawHDD DrawHDD Light%, iRow%, iCol%, Msg$ DrawHDD Similar to DrawFDD but draws a text picture of a hard disk and places the current drive (CURDRIVE) letter in the box. Pass 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 Returns _______ Nothing DrvSpace DrvSpace (Drive$, Total&, Free&, EC%) DrvSpace Returns total space and free space (in bytes) of drive Drive$. Pass Pass ____ Drive$ Disk drive letter (e.g., "C") Returns 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 -14- -14- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. ElapsedTime ElapsedTime STime$, ETime$, Hour%, Minutes%, Secs% ElapsedTime Calculates elapsed time. Pass Pass ____ STime$ Starting time hh:mm:ss (same format as TIME$ function) ETime$ Ending time hh:mm:ss (same format as TIME$ function) Returns Returns _______ ETime$ Formatted elapsed time (hh:mm:ss) Hour% Elapsed hours Minutes% Elapsed minutes Secs% Elapsed seconds Example Example _______ S$ = TIME$ 'Starting time (do whatever needs to be done) E$ = TIME$ 'Ending time ElapsedTime S$, E$, H%, M%, S% ErrScn ErrScn ErrCode%, Module$ ErrScn Presents an error screen showing error number, english text, possible solution, and module name. Pass Pass ____ ErrCode% Error number Module$ Module name Returns Returns _______ Nothing ErrSolve$ ErrSolve$ Number% ErrSolve$ Prints possible solution to error number Number%. Used by subroutine ErrScn. Not very extensive (to save memory), but it sure beats no error handling... -15- -15- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. ErrText$ ErrText$ Number% ErrText$ Prints text of error Number%. Used by ErrScn. -16- -16- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. FKeys FKeys Keys$ FKeys Displays a list of function keys at the bottom of the screen. Pass 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 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 -17- -17- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. FmtFDD% Ok% = FmtFDD% FmtFDD% Format floppy disks. Pass Pass ____ Nothing Returns Returns _______ TRUE if function completed FALSE if cancelled Notes 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. -18- -18- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. FontDL FontDL FontFile$, Pts%, Port%, FontNo% FontDL Downloads a soft font file to a laser printer and displays a status window while doing so. Pass 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 Returns _______ Pts% The point size of the font is returned in this variable. Example Example _______ ok% = FontDL%(FontFile$, Pts%, Port%, FontNo%) if ok% then PRINT #PrintFile%, chr$(27)+"("+ltrim$(str$(FontNo%))+"X" end if Notes 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" chr$(27)+"("+ltrim$(str$(FontNo%))+"X" -19- -19- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. FromFDD% ok% = FromFDD%(FileMask$, Method%) FromFDD% Presents a list of available floppy drives then restores FileMask$ files from floppy Drive$ using Method%. Pass 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 Returns _______ TRUE if completed, else FALSE -20- -20- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. GetDate GetDate d%, m%, y%, Intl%, Row%, Col% GetDate 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 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 Returns _______ d%, m%, and y% are set to user's input -21- -21- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. GetFileName$ thefile$ = GetFileName$(InOut%, title$, Msg$) GetFileName$ Get a file name from user in a window, verify proper format of entry, and check status of file. Pass Pass ____ InOut% Input or Output file? 0 = Input file (file must exist; error message displayed if not) 1 = Output file (checks that file does not exist; not if file exists, presents a warning that file will be over-written) Title$ Title of window Msg$ Help message displayed on the screen below the file entry window Returns Returns _______ Name of file, including drive and path (if entered) GetFontInfo GetFontInfo File$, FontName$, PtSize% GetFontInfo Provides name & size in the header of a soft font file. Try FontDL% on your laser for a demonstration of this. Pass Pass ____ File$ The name of the soft font, including drive and path, if necessary. Returns 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. -22- -22- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. GetNum$ n$ = GetNum$(iRow%, iCol%, NumMask$, OrigNo$, ExitCode%) GetNum$ Get formatted numerical input from user. Screen colours at the specified location will be inverted during input and restored upon exit. Pass 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 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 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. -23- -23- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. GetValidPath GetValidPath Drv$, path$, Msg$, ms% GetValidPath 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 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 Returns _______ Drv$ Selected drive letter followed by a colon Path$ Selected path with trailing foreslash (\) (e.g., "\TEST\DIR\") Notes Notes _____ The mouse must be initialized and visible to use it. -24- -24- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. GoodbyeScreen GoodbyeScreen Pkg$, Reg%, FirstUse$, TimesUsed% GoodbyeScreen 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 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 Returns _______ Nothing -25- -25- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. HelpIndex HelpIndex HelpIndex Looks on the disk for a file ending in ".HLP" and uses it as a help file. A Help index is presented in a scrollable menu. Once the user selects a topic, the help text is displayed using Inform%. The help file is an ASCII text file which is arranged as follows: Topic #1+chr$(4)+Help information more information at least one space from left more help etc. etc. Topic #2+chr$(4)+Help info... Notes Notes _____ Your help file may contain up to 70 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. -26- -26- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. Inform% ok% = Inform%(iRow%, iCol%, iWid%, iType%, ms%, snd%, Msg$) Inform% This is a routine to display a scrollable information window containing up to 99 lines of information. Msg$ may be any length; it will be truncated at 99 lines if necessary. 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 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 Returns _______ TRUE if user presses ENTER to exit FALSE if user presses ESC to exit Notes Notes _____ All message types except zero restore the screen on exit. iType%=0 is useful when you want to put information on the screen and leave it there, such as instructions to a user on how to enter data. Custom Titles Custom Titles _____________ A custom title can be placed at the top of the box by placing a chr$(4) in your message just after the title. If you do so, this title will replace the default. -27- -27- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. InformFill InformFill iRow%, iCol%, BegLine%, WinSize%, MLines$() InformFill Used by Inform% -- fills the window with text. InputDate InputDate MonthNo%, Day%, Year%, Row%, Col%, ExitCode% InputDate 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 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 Returns _______ ExitCode% Set to the key used to exit. Example 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 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. -28- -28- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. IsColour% x% = IsColour% IsColour% Get adapter card type. Pass Pass ____ Nothing Returns Returns _______ True (-1) if colour adapter card, otherwise False (0). Max% Highest% = Max%(A%, B%) Max% Returns the larger of the two integers MaxL& Highest& = MaxL&(A&, B&) MaxL& Returns the larger of two long integers. MaxS! Highest! = MaxS!(A!, B!) MaxS! Returns the larger of two single-precision floating point numbers. Min% Lowest% = Min%(A%, B%) Min% Returns the smaller of two integers. MinL& Lowest& = MinL&(A&, B&) MinL& Returns the smaller of two long integers. MinS! Lowest! = MinS!(A!, B!) MinS! Returns the smaller of two single precision numbers. -29- -29- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. MonthDays% NoDays% = MonthDays%(M%, Y%) MonthDays% Returns the number of days in month M% of year Y%. Pass Pass ____ M% Month (1-12) Y% Year (2 or 4 digits) Returns Returns _______ Number of days in the specified month Example Example _______ MonthDays%(2,1992) returns 29 MouseSet% ms% = MouseSet% MouseSet% Initializes the mouse, makes the cursor a diamond, but leaves the cursor invisible. Pass Pass ____ Nothing Returns Returns _______ Nothing OutDev$ PDev$ = OutDev$ OutDev$ Presents a menu of output devices including 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 Pass ____ Port% Port number of printer Returns Returns _______ Device or file name -30- -30- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. ParseFSpec ParseFSpec TheName$, Drv$, Pathname$, TheName2$ ParseFSpec Searches full file name for the drive, path, and NAME.EXT components. Pass Pass ____ TheName$ Full file name to parse Returns 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 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. -31- -31- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. PctDone PctDone Percent%, title$ PctDone Displays a graph of percentage completion in a small box on the screen. Pass 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 Returns _______ Nothing Notes Notes _____ You must call PctDone with 100 to clear it or the next time you You must call PctDone with 100 to clear it call it it will think the window is still on the screen... Example 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$ PrintRptMsg Displays a window saying "Printing "+Rpt$+" Press Esc to cancel." I use this on every report so I made it into a routine. Example Example _______ Rpt$ = "Stock Status Report" PrintRptMsg Rpt$ -32- -32- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. PtrReady% ok% = PtrReady%(Port%) PtrReady% Checks if printer on LPT[Port%] is on-line. Pass Pass ____ Port% Printer port (1, 2, or 3) Returns Returns _______ TRUE if ready, FALSE if not Notes 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% QSort 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$) Repl$ Replaces occurence of Target$ in St$ with Item$. Good for laser printer codes. Pass Pass ____ St$ Complete string Target$ The part of St$ to be replaced Item$ The replacement for Target$ Returns Returns _______ The modified string. Example Example _______ Repl$("&a#V","#","500") will return "&a500V" -33- -33- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. SayOk SayOk iRow%, iCol% SayOk Puts an "Ok" button centred at position iRow% and iCol% and puts an "Enter / Continue" message at the bottom of the screen. Mouse or keyboard can be used to exit. Pass Pass ____ iRow% Row on which to place button iCol% Middle of button Returns Returns _______ Nothing SearchPath$ a$ = SearchPath$(FileName$) SearchPath$ Searches the DOS PATH environment variable for a file. Pass Pass ____ FileName$ Name of file for which to search (file name only; only no drive or path) Returns Returns _______ If file is found, DOS path with trailing foreslash (\) If file is not found, returns blank string ("") not Example Example _______ Assuming you have C:\ in your search path... A$ = SearchPath$("Config.sys") will set A$ = "C:\" -34- -34- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. SelectFont% ok% = SelectFont%(m$,Ptr$,PtrNo%,Pts%,Ext$,SFdir$,ms%) SelectFont% 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 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 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 Ptr$ Printer type, D=Dot matrix, L=Laser Pts% Changed to point size if scalable font Notes Notes _____ Mouse must be initialized but turned OFF -35- -35- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. SelectFontSize% Pts% = SelectFontSize%(Font$, action$, ms%) SelectFontSize% 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 Pass ____ Font$ The font name (for displaying on the screen). For example, CG Times. action$ The use for the font (i.e., Return Address). This message is displayed at the top of the window followed by " Size". ms% Mouse flag: 0=no mouse, 1=use mouse Notes Notes _____ This routine is called by SelectFont%. Mouse must be initialized and turned ON. SelectSoftFont$ Font$ = SelectSoftFont$(Path$, Ext$, ms%) SelectSoftFont$ 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 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 Returns _______ Name of chosen font, including drive & path, if necessary. -36- -36- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. StrFmt$ ph$ = StrFmt$(St$, mask$) StrFmt$ Formats a string according to a given mask. I use this to format phone numbers, etc. Pass Pass ____ St$ String to format Mask$ Mask Returns Returns _______ Formatted string Example Example _______ a$ = StrFmt$("8052662574","(###) ###-####") returns a$ = "(805) 266-2574" StripSymbols$ new$ = StripSymbols$(Old$) StripSymbols$ 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 Example _______ a$ = StripSymbols$("(805) 266-2574") returns a$ = "8052662574" -37- -37- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. ToFDD% ToFDD% (FileMask$, Method%) ToFDD% Presents a list of available floppy drives (if more than one available) then backs-up FileMask$ to drive Drive$ using Method%. Pass 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 Returns _______ TRUE if completed FALSE if aborted Trim$ b$ = Trim$(a$) Trim$ 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. -38- -38- ANGELIB for BC7/PDS ANGELIB for BC7/PDS ___________________ Copyright (c) 1992, Angel Babudro. All rights reserved. ZipFmt$ a$ = ZipFmt$(TheZip$, Intl%) ZipFmt$ Formats a zip code according to Intl% flag. Pass Pass ____ TheZip$ Unformatted Zip/Postal code Intl% Country setting 1 = USA 2 = Canada 3 = USA and Canada 4 = All others (no formatting) Returns Returns _______ Formatted zip USA -- #####-#### Canada -- A#A #A# Other -- No formatting done zTrim$ b$ = zTrim$(a$) zTrim$ This routine only trims trailing nulls [chr$(0)] from the string. only 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. -39- -39-