home *** CD-ROM | disk | FTP | other *** search
- ╔════════════════════════════════════════════════════════════════════════╗
- ║ PASCAL LIBRARY LIST 8/2/85 SCOTT WADE ║
- ╚═════════╦═══╦══════════════════════════════════════════════╦═══╦═══════╝
- ║ ║ Pascal Library by Scott Wade ║ ║
- ║ ║ 715 FM 1959 Apt 310 ║ ║
- ║ ║ Houston, TX 77034 ║ ║
- ┌──────╨───╨──────────────────────────────────────────────╨───╨──────┐
- │ This group of routines is contributed to public domain, and no │
- │ one can possibly get any commercial value out of them since they │
- │ must be used in other programs. I require that if these are used │
- │ as is in any program, that this banner remain with the source │
- │ code of the program. I would appreciate any comments or sugges- │
- │ tions on improvements, & am curious to hear how these are used. │
- │ You can leave a message for me on these BBS's: │
- │ Ziggy's 821-1391 ScoreBoard 583-7848 │
- │ TBL-COMM 661-9040 Test-Mode 660-9252 │
- └────────────────────────────────────────────────────────────────────┘
-
- LIBLIST.DOC is the most important part of this library: all LIBs and their
- var parameter requirements are defined in LIBLIST.DOC. This is the primary
- documentation of the LIBs, with only the explanations of how to use them, what
- will be passed to/from them, and unusual conditions to be alert for.
-
- LIB files, have an extension of .LIB, may have more than one proc (should
- have, even) and will be documented together on the system disk in the
- file 'LIBLIST.DOC'. All vars passed to & from the LIB are set up in
- agreement with the declarations found in GLOBALS.PAS THERE WILL BE NO
- parameters passed that are not declared in this file!!! Only by declaring
- all at once is it possible to keep track of what proc needs what var.
- Note that GLOBALS has only TYPE declarations, not VAR,CONST,etc.
-
- All procs in a LIB start with the same letter as the LIB. All LIBs start
- with different letters, in reverse alphabetic order. This prevents any
- possibility of duplicate procnames. Variables are named by preference. NO LIB
- will reference ANY variable NOT declared in the Procedure declaration or
- internally! In other words, don't count on the caller to assume the LIB knows
- about a global variable not identified in the calling statement. This is a
- good idea with regular procs, also.
-
- LIBLIST.DOC will contain the documentation on ALL LIBs, always.
-
- HINTS : LIBS should not, where possible to avoid it, actually output to the
- CRT or LST. Instead, pass output back to the caller and allow the caller to
- decide what to do with the output. This is because the caller may have:
- >Special screen format set up that requires some preprocessing, such as
- hyphenating or breaking the line at a space, or the printer may be set up
- for 132 or 80 or 120 or 66 chars/line, etc.
- >File output, such as a job log, may be desired instead of crt or lst output.
- >May only desire part of the actual output line.
- For additional documentation, see the individual LIB.
-
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
- zKeys.LIB v1.0 8/2/85
- This will accept any type of keyboard input, and return an Integer or Real,
- depending on what you want. Note that this lib is NOT set up to use yPrnt.LIB.
- ■ v1.1 9/27/85 procedure zString was deleted from the LIB.
-
- ■ zStripBlanks( var Blankit : Buffer );
- This strips the leading blanks off of Blankit.
- ■ zGetKey;
- prompts for a keypress and waits until a key is pressed.
- ■ zInt(var KeyInt : integer ; PromptLin : Buffer );
- Promptlin is the line to print before reading from keyboard. Promptlin will
- be repeated until an integer is input. KeyInt is the integer that is
- returned to the caller.
- ■ zReal(var KeyReal : Real ; PromptLin : Buffer );
- Promptlin is the line to print before reading from keyboard. Promptlin will
- be repeated until a real is input. KeyReal is the real that is returned to
- the caller.
-
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
- yPrnt.LIB v1.0 11/12/85
- This will print on CON, breaking lines at spaces, putting next output line
- after previous lines. Any line ending with ^ will cause a return/linefeed. To
- do a blank linefeed, set output line := '^'.
- ■ v1.1: 12/13/85 : yCaps added.
- ■ v1.2: 2/20/86 : yPrntI added.
-
- ■ yPrnt( var wX : Integer; var OutLin : Buffer );
- This works independantly of cursor position on screen, but will be messed up
- if any other part of your program outputs to the screen without setting
- wX := WhereX. OutLin is returned null.
- ■ yCaps( var wX : Integer; var OutLin : Buffer );
- This will capitalize the first letter, add a period, then call yPrnt with
- the sentence. If OutLin ends in ^, this will insert the . right before it,
- so the RET is unaffected. Works like a champ.
- ■ yPrntI( var wX : Integer; Just, OutInt : Integer );
- This will yPrnt the specified Integer number OutInt in a field justified to
- Just number of spaces. Remember that yPrnt will also add 1 space before this
- when the number is printed.
-
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
- xCommand.LIB v1.0 8/2/85
- This returns the parameters entered with the name of the command file. This
- allows .COM files to access the start command line.
- ■ v2.3 9/27/85 Some cleanup work done.
-
- ■ xCommand(var Parms : buffer )
- This returns the command line, w/out the name of the COM file. The line is
- intact, unparsed. This should be the 1st proc used in the program or parts
- of the command line may be corrupted.
- Or so I'm told...I haven't had any problems yet.
- ■ xCmdParse( CmdParm : buffer ; var CmdList : LongWordList ;
- var TotalParms : Integer ;)
- This returns the command line, separated at the commas. Parameters entered
- are in CmdList, and TotalParms is how many were entered.
-
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
- wTime.LIB v1.2 8/00/85
- MS-Dos Current Time and Date library.
- ■ v1.1 9/27/85 The '19' is chopped from year to allow the date to fit into
- global type word : string[ 10 ]
- ■ v1.2 10/17/85 procedure wMONTH added to allow other routines to convert
- integers 1-12 to months. wTime calls wMonth.
-
- ■ wMonth( mnth : integer ; var Date : word );
- converts the integer mnth to a 3 letter string for the month, for example,
- if Mnth = 3 then DATE will be returned as MAR. Integers out of range are
- returned as ERR.
- ■ wTime( var Time, Date : Word);
- Returns time and Date as HH:MM:SS and MON/DD/YY, where all are
- integers except MON, which is a 3-letter string.
-
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
- vIOErr.LIB v1.0 8/8/85
- This will return a message for errors in file/device IO.
- ■ v1.1 12/7/85 Put remark statements in the right place & added to msg 02.
- ■ v1.2 4/ 6/86 : Function vTrueIfErr added.
-
- ■ vIOerr( var IOErrMsg : Buffer ;var IOErrVal : Integer ;
- var IOErr : Boolean );
- IOErrMsg will be the message returned after the IO is tried, IOErrVal will
- be the value of IOResult and IOErr will be True. If no Error is encountered,
- IOErrMsg will be unchanged, IOErr will be False and IOErrVal will be 0.
- ■ F vTrueIfErr( IOErrVal: integer; IOErrMsg : Buffer ): Boolean ;
- This will print the errmsg, if there is one, and returns True if IOErrVal
- is non-zero. This uses writeln, not yPrnt, so yPrnt programs must take this
- into account.
-
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
- tOption.Lib v1.0 4/11/86 Command option parser.
- ■ v1.0: 4/11/86 : original
-
- ■ tOption( var BufLine : Buffer ; var AscInt : Integer );
- This will extract a one-letter option that is preceded by /. For example:
- JOBRUN /f filename.ext
- will return 70, the ascii equivalent of 'F', and the buffer will be
- ' filename.ext' NOTE: it converts to uppercase!