home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ZROUTINE.ZIP / ZROUTINE.TXT < prev   
Encoding:
Text File  |  1989-01-14  |  32.1 KB  |  887 lines

  1.  
  2. ZRoutine Documentation                                          January 14, 1989
  3. Version 1.1                                                               Page 1
  4.  
  5.  
  6.  
  7.     _________________________________________________________________________
  8.  
  9.                             Introduction to ZROUTINE
  10.     _________________________________________________________________________
  11.      There is a Table of Contents at the back of this document!
  12.      
  13.      ZRoutines are a collection of Turbo Pascal routines I find priceless
  14.      in coding my programs. I used to code in Quick Basic and became
  15.      dependent on some of its procedures and function. I have written them
  16.      as Pascal units.
  17.      
  18.      To make sure that there is no confusion, all of the units in this
  19.      collection begin with the letter Z.
  20.      
  21.      The author of these routines is Bob Zimmerman. I have gotten many
  22.      ideas from other public domain software and from other books and
  23.      manuals. I am sure there are other routines out there.
  24.      
  25.      I am taking pride in this documentation and support. All requests
  26.      should be addressed to:
  27.      
  28.  
  29.                Bob Zimmerman
  30.                CompuServ 72371,1700
  31.                
  32.                or
  33.                
  34.                Bob Zimmerman
  35.                Sysop: The Mainframe BBS
  36.                2400/1200/300 8N1
  37.                24 Hours
  38.                (312) 364-0425 after Nov 1989 the area code is 708
  39.                (708) 364-0425...
  40.                
  41. ZRoutine Documentation                                          January 14, 1989
  42. Version 1.1                                                               Page 2
  43.  
  44.  
  45.     _________________________________________________________________________
  46.  
  47.                              Printing this document
  48.     _________________________________________________________________________
  49.      
  50.      This document may be printed by copying it to the printer using the
  51.      dos command:
  52.      
  53.      COPY ZROUTINE.TXT PRN
  54.      
  55.      The file is formatted to print on 10 x 8 inch paper. The reason I am
  56.      not using 11 inch formatting when creating this document, is so it
  57.      will print on a laser printer correctly (some only support 60 lines
  58.      per page.
  59.      
  60.      Also, to make sure it will print on all printers, there is no bolding
  61.      or any other fancy font. I use the underscore chars to form the
  62.      heading lines and the form feed character to eject to a new page.
  63.      
  64.      Hard copies of this document may be requested from the author. A
  65.      charge will be requested depending on the quality of the printout you
  66.      request (laser versus dot matrix...).
  67.      
  68. ZRoutine Documentation                                          January 14, 1989
  69. Version 1.1                                                               Page 3
  70.  
  71.  
  72.     _________________________________________________________________________
  73.  
  74.                     ZBeep - Sound a beep "x" number of times
  75.     _________________________________________________________________________
  76.      Procedure ZBeep (Number_Of_Times : integer);
  77.      
  78.      This routine will sound the speaker the number of times specified. I
  79.      have had alot of trouble remembering the exact pitch etc... used by
  80.      most utils. Once I found it, I created this module. For example...
  81.      
  82.      Example:
  83.      
  84.      (*   To sound a single beep        *)
  85.      
  86.      ZBeep (1);
  87.      
  88.      (*   To sound 10 beeps             *)
  89.      
  90.      ZBeep (10);
  91.      
  92. ZRoutine Documentation                                          January 14, 1989
  93. Version 1.1                                                               Page 4
  94.  
  95.  
  96.  
  97.      
  98.     _________________________________________________________________________
  99.  
  100.                          ZCmd - Global string variable
  101.     _________________________________________________________________________
  102.      Var ZCmd : String;
  103.      
  104.      This a variable that is created at the beginning of every program. It
  105.      will contain the entire command line, each parameter being separated
  106.      by a single space.
  107.      
  108.      Normally, in Turbo Pascal, there is no one parameter containing the
  109.      entire command line (for printing etc...). This one is it.
  110.      
  111.      
  112.      Example:
  113.      
  114.      PROGRAM PrntCmd;
  115.      
  116.      (*   This program echos the command line back to the screen
  117.           in order to demonstrate the ZCmd string. Execute this
  118.           program with several different command lines to see the
  119.           spaces squashed out etc...                        *)
  120.      
  121.      begin
  122.           Writeln(ZCmd);
  123.      end.
  124. ZRoutine Documentation                                          January 14, 1989
  125. Version 1.1                                                               Page 5
  126.  
  127.  
  128.     _________________________________________________________________________
  129.  
  130.      ZCmdInt - returns a command line integer Function ZCmdInt (A_String :
  131.      string ) : integer;
  132.      
  133.      This function is exactly like the ZCmdStr, except it returns an
  134.      integer. For example, is a /p parm is used to specify page length, you
  135.      could use this function to retrieve it...
  136.      
  137.      
  138.      Example:
  139.      
  140.      THECMD /p60
  141.      
  142.      
  143.      The above command line would generate:
  144.      
  145.      ZCmdInt('/p')   returns 60
  146.      
  147.      
  148.      Notes:
  149.      
  150.      If the user specifies alpha data, or no data, this function returns 0.
  151. ZRoutine Documentation                                          January 14, 1989
  152. Version 1.1                                                               Page 6
  153.  
  154.  
  155.     _________________________________________________________________________
  156.  
  157.      ZCmdKeyWord - Checks for keyword on command line Function ZCmdKeyWord
  158.      ( A_String : string ) : boolean
  159.      
  160.      This function either returns True or Flase depending on whether or not
  161.      the passed "keyword" was specified on the dos command line.
  162.      
  163.      
  164.      Example:
  165.      
  166.      THECMD  c:\autoexec.bat /move save
  167.      
  168.      if the above is the command line entered at the dos prompt, then the
  169.      following is true:
  170.      
  171.      
  172.      ZCmdKeyWord('/move')  is true
  173.      ZCmdKeyWord('save')   is true
  174.      ZCmdKeyWord('move')   is false
  175. ZRoutine Documentation                                          January 14, 1989
  176. Version 1.1                                                               Page 7
  177.  
  178.  
  179.     _________________________________________________________________________
  180.  
  181.                      ZCmdPos - Get the positional parameter
  182.     _________________________________________________________________________
  183.      Function ZCmdPos (The_Pos : Word) : String;
  184.      
  185.      This function returns the positional parameter on the command line.
  186.      Here is an explanation of its processing.
  187.      
  188.      Starting with the first command line parameter, it checks if the first
  189.      byte is a slash (/). If it is, it skips that parm. If it is not, this
  190.      is considered a "positional" parameter. You specify which positional
  191.      parameter you want the function to be returned.
  192.      
  193.      
  194.      Example:
  195.      
  196.      The dos command line looks like this...
  197.      
  198.      THECOMMAND  /r bob zimmerman /q /d whatever
  199.      
  200.      
  201.      Using the above command line... the following is true:
  202.      
  203.      ZCmdPos(1)     is equal to "bob"
  204.      ZCmdPos(2)     is equal to "zimmerman"
  205.      ZCmdPos(3)     is equal to "whatever"
  206.      ZCmdPos(4...)  is equal to "" (nothing)
  207.      
  208.      
  209.      Notes:
  210.      
  211.      If there are no positional parameters, then a string of length 0 is
  212.      returned. ZCmdPos(0) or ZCmdPos(-1) yields unpredictable results...
  213. ZRoutine Documentation                                          January 14, 1989
  214. Version 1.1                                                               Page 8
  215.  
  216.  
  217.     _________________________________________________________________________
  218.  
  219.                     ZCmdStr - return command line parameter
  220.     _________________________________________________________________________
  221.      Function ZCmdStr (A_String : string) : string;
  222.      
  223.      This function returns the value for a command line parameter. You are
  224.      able to misuse this command if you don't understand its intention. If
  225.      your utility can receive a path parameter in the form of /pc:\, where
  226.      the /p is the "key" and the c:\ is the value, then the ZCmdStr would
  227.      look like this:
  228.      
  229.      
  230.      Example:
  231.      
  232.      (* find out the value of the /p specified on the command line *)
  233.      Value := ZCmdStr('/p');
  234.      
  235.      
  236.      Notes:
  237.      
  238.      This function works regardless of case. If the command line contains
  239.      just the key (/p in our example), or the key (/p) is not specified at
  240.      all, the function returns a string of length 0.
  241. ZRoutine Documentation                                          January 14, 1989
  242. Version 1.1                                                               Page 9
  243.  
  244.  
  245.     _________________________________________________________________________
  246.  
  247.        ZColor - Set Text color Procedure ZColor (Foreground, Background :
  248.      integer);
  249.      
  250.      The real purpose is too make pascal a bit easier for Basic
  251.      programmers. Instead of using the TextColor and BackColor procedures,
  252.      you may specify both in one statement...
  253.      
  254.      
  255.      Example:
  256.      
  257.      (* set color to yellow on blue background *)
  258.      ZColor (14,1);
  259.      
  260. ZRoutine Documentation                                          January 14, 1989
  261. Version 1.1                                                              Page 10
  262.  
  263.  
  264.     _________________________________________________________________________
  265.  
  266.                    ZCsr Procedures - modify Cursor Attributes
  267.     _________________________________________________________________________
  268.      The following procedures have no parameters. They modify your cursor
  269.      display attributes as described:
  270.      
  271.           ZCsrNone;      turns off the cursor from being displayed.
  272.           ZCsrBlock;          makes the cursor a full block cursor.
  273.           ZCsrNormal;    makes the cursor a normal underscore type.
  274.           ZCsrHalf;      makes the cursor half of a block cursor.
  275.           
  276.           ZCsrSize(x,y); allows you to explicitly code the scan values for
  277.                               the cursor.
  278. ZRoutine Documentation                                          January 14, 1989
  279. Version 1.1                                                              Page 11
  280.  
  281.  
  282.     _________________________________________________________________________
  283.  
  284.                        ZLPadInt - Generate leading zeros
  285.     _________________________________________________________________________
  286.      Function ZLPadInt (TheVal, NumOfBytes : Integer) : string;
  287.      
  288.      Many times, I would like to print an integer with leading zeros. By
  289.      default, leading zeros are stripped. Even using the formatting on the
  290.      Writeln command, the numbers are padded with spaces not zeros.
  291.      
  292.      This function forces numbers to be printed with leading zeros.
  293.      
  294.      
  295.      Example:
  296.      
  297.      (* I want to print numbers 1 to 100 aligned with leading zeros... *)
  298.      
  299.      var
  300.           x : integer;
  301.      
  302.      begin
  303.           for x := 1 to 100 do
  304.                Writeln( ZLPadInt (x, 3) );
  305.      end;
  306.      
  307.      
  308.      "x" is the number 1 to 100 (the for statement increments it)...
  309.      "3" specifies to pad it to 3 digits... Output looks like:
  310.      
  311.      001
  312.      002
  313.      003
  314.      ..
  315.      ..
  316.      010
  317.      011
  318.      ..
  319.      ..
  320.      100
  321.      
  322. ZRoutine Documentation                                          January 14, 1989
  323. Version 1.1                                                              Page 12
  324.  
  325.  
  326.     _________________________________________________________________________
  327.  
  328.                         ZInput - Formatted Input Routine
  329.     _________________________________________________________________________
  330.      Procedure ZInput;
  331.      
  332.      This routine is a full screen formatted input routine. By filling in
  333.      the arrays described below, you tell the routine where fields are on
  334.      the screen. Then you invoke the ZInput Procedure. ZInput allows the
  335.      user to use page down and up to get to the 1st and last field,
  336.      tabbing, the HOME and END keys, CTL-END and more. The user is in
  337.      control until any key that takes a 2 byte scan code is pressed. For
  338.      example, the PFkeys, CTL- combinations etc... Also, pressing ENTER on
  339.      the last field, or the ESC key exits the procedure.
  340.      
  341.      All data is optionally validated...
  342.      The following describes the variables (global) used when running
  343.      ZINPUT!:
  344.      
  345.           ZIRow[1..25]   Specify the row the field is on.
  346.                          Use an index of 1 thru 25 for which field.
  347.                          In other words, you can define up to 25 fields.
  348.           
  349.           ZICol[1..25]   Specify the column the field starts in.
  350.                          Use an index of 1 thru 25 for which field we are
  351.                          on.
  352.           
  353.           ZILen[1..25]   Specifies the length of each field.
  354.           
  355.           ZIData[1..25]  Specifies the data. If you set this prior to
  356.                          invoking Zinput, the data is displayed to the user
  357.                          for modification. After Zinput, the data the user
  358.                          entered is returned to the program in this array.
  359.           
  360.           ZIInvalid[1..25]
  361.                          This array is used for editing. If the user is
  362.                          allowed to enter any data in the field, leave the
  363.                          field null (ZIInvalid[1] := '')...
  364.                          
  365.                          If the user is only allowed to enter certain
  366.                          chars, for example Numeric data, then set the
  367.                          array entry to the list of valid chars. For
  368.                          example, ZIInvalid[1]:='0123456789'.
  369.           
  370.           ZINumOfFields  contains the number of fields on the screen. You
  371.                          must set this before you invoke ZInput.
  372.           
  373.           ZIKeyPressed   is returned with which key was pressed by the user
  374.                          when returning control to your program.
  375.           
  376.           
  377.           continued on next page...
  378. ZRoutine Documentation                                          January 14, 1989
  379. Version 1.1                                                              Page 13
  380.  
  381.  
  382.  
  383.           
  384.      Example:
  385.           
  386.      { We want 2 data entry fields on the screen.
  387.      The first is a name field starting in column 5 row 10 for 20 bytes.
  388.      The next is a Yes or No prompt starting in column 5 row 11 for 1 byte.
  389.      This field should be intially set to Y.
  390.      }
  391.      
  392.      ZIRow [1] := 10;
  393.      ZICol [1] := 5;
  394.      ZILen [1] := 20;
  395.      ZIData[1] := '';
  396.      ZIInvalid[1] := '';
  397.      
  398.      
  399.      ZIRow [2] := 11;
  400.      ZICol [2] := 5;
  401.      ZILen [2] := 1;
  402.      ZIData[2] := 'Y';
  403.      ZIInvalid[2] := 'YyNn';
  404.      
  405.      ZINumOfFields := 2;
  406.      
  407.      repeat
  408.      
  409.           ZColor ( forground, background ); (* highlit color *)
  410.           ZInput;
  411.           ZColor ( forground, background ); (* normal color *)
  412.      
  413.           if ZIKeyPressed := #27 then exit
  414.           ZBeep (1);
  415.      
  416.      Until ZKeyPressed = #13;
  417.      
  418. ZRoutine Documentation                                          January 14, 1989
  419. Version 1.1                                                              Page 14
  420.  
  421.  
  422.     _________________________________________________________________________
  423.  
  424.                         ZIOCheck - Did an IO error occur
  425.     _________________________________________________________________________
  426.      Function ZIOCheck : Boolean;
  427.      
  428.      This function will run the ZIOResult procedure and sets itself to the
  429.      value of ZIOErr.
  430.      
  431.      What this means to you, is that, this is an easy way to check the
  432.      status of IO errors after doing the I/O. See the example for more
  433.      info...
  434.      
  435.      
  436.      Example:
  437.      
  438.      (* Open the file, if it does not exist, create the file *)
  439.      
  440.      Assign (TheFile, 'temp.dat');
  441.      
  442.      {$I-}  Reset (TheFile); {$I+}
  443.      
  444.      If ZIOCheck then ReWrite (TheFile);
  445.      
  446.      {
  447.           In the above example, we are trying to first open an existing
  448.           file called TEMP.DAT. The $I- tells the compiler to let IO errors
  449.           fall back into the code since normally IO errors stop a program
  450.           immediately. The ZIOCheck will be set to true if an IO error
  451.           occurred. If it did, we assume it is because of the file not
  452.           existing and we CREATE (rewrite) the file. If this fails, the
  453.           system will generate a run time error.
  454.           
  455.           See ZIOVerify for a cleaner implementation of this code!
  456.      }
  457.      
  458. ZRoutine Documentation                                          January 14, 1989
  459. Version 1.1                                                              Page 15
  460.  
  461.  
  462.     _________________________________________________________________________
  463.  
  464.                  ZIOErr - Global variable var ZIOErr : Boolean;
  465.      
  466.      This variable is used by the routines ZIOCheck, ZIOVerify and
  467.      ZIOResult, documented in this manual.
  468.      
  469.      After ZIOResult, which is used by the other ZIO routines, ZIOErr is
  470.      set to true or false depending on whether an IO Error occurred. If an
  471.      IO error occurred, ZIOErr will be set to true.
  472.      
  473.      
  474. ZRoutine Documentation                                          January 14, 1989
  475. Version 1.1                                                              Page 16
  476.  
  477.  
  478.     _________________________________________________________________________
  479.  
  480.                            ZIOResult - Check IOResult
  481.     _________________________________________________________________________
  482.      Procedure ZIOResult(var x : integer;  var msg : string);
  483.      
  484.      This procedure analyzes IOResult (built into pascal) and determines if
  485.      the last IO generated an error. If it did, the error number is placed
  486.      in the integer being passed, ZIOErr is set to true and "msg" will
  487.      contain the reason the error occurred.
  488.      
  489.      
  490.      Example:
  491.      
  492.      {$I-}
  493.      Rewrite (thefile);
  494.      {$I+}
  495.      
  496.      ZIOResult (errnum, errmsg);
  497.      
  498.      if ZioErr then begin
  499.           Writeln('An io error has occurred');
  500.           Writeln('Error number: ', errnum);
  501.           Writeln('Error message: ', errmsg);
  502.           ZBeep(2);
  503.           halt(1);
  504.           end;
  505.      
  506. ZRoutine Documentation                                          January 14, 1989
  507. Version 1.1                                                              Page 17
  508.  
  509.  
  510.     _________________________________________________________________________
  511.  
  512.                    ZIOVerify - Verify the previous IO worked
  513.     _________________________________________________________________________
  514.      Procedure ZIOVerify;
  515.      
  516.      This procedure will run ZIOResult. If ZIOErr is equal to true, meaning
  517.      an IO error occurred, then the alarm is sounded and 3 lines of
  518.      diagnostics are printed.
  519.      
  520.      These messages are clearer then the simple "run time error" issued by
  521.      Pascal. They will explain why the io error occurred (e.g. Invalid
  522.      path, file not found etc...)
  523.      
  524.      
  525.      Example:
  526.      
  527.      (* Open the file, if it does not exist, create the file *)
  528.      
  529.      Assign (TheFile, 'temp.dat');
  530.      
  531.      {$I-}  Reset (TheFile); {$I+}
  532.      
  533.      If ZIOCheck then
  534.           begin
  535.           {$I-} ReWrite (TheFile); {I+}
  536.           ZIOVerify;
  537.           end;
  538.      
  539.      
  540.      {
  541.           See the example under ZIOCheck for a full explanation of this
  542.           example. The new line ZIOVerify will verify the rewrite works. If
  543.           it does not, a formatted error message is displayed and the
  544.           program is halted.
  545.      
  546.      }
  547. ZRoutine Documentation                                          January 14, 1989
  548. Version 1.1                                                              Page 18
  549.  
  550.  
  551.     _________________________________________________________________________
  552.  
  553.                           ZLTrim - Trim leading spaces
  554.     _________________________________________________________________________
  555.      Function ZLTrim (A_STring : string) : string;
  556.      
  557.      Returns the string without any leading spaces.
  558.      
  559.      
  560.      XYZ := ZLTrim('   Bob');
  561.      
  562.      
  563.      XYZ will be equal to "Bob" without the leading spaces!
  564. ZRoutine Documentation                                          January 14, 1989
  565. Version 1.1                                                              Page 19
  566.  
  567.  
  568.     _________________________________________________________________________
  569.  
  570.                         ZMakeWindow - Generate a window
  571.     _________________________________________________________________________
  572.      Procedure ZMakeWindow (LeftColumn, TopRow, RightColumn, BottomRow,
  573.                               : integer;
  574.                               Foreground, Background : byte;
  575.                               Windowtype             : integer;);
  576.      
  577.      
  578.      This procedure is still under development but works fine. You specify
  579.      the dimensions of the box you want drawn. Specify the foreground and
  580.      background color, as well as a border type (windowtype). Currently,
  581.      window type must be 1 or 2.
  582.      
  583.      
  584.      Example:
  585.      
  586.      
  587.      ZMakeWindow (2,2,79,24,14,1,1);
  588.      
  589.      The above draws a box around your entire screen. (note you must leave
  590.      a byte around the edge for the border.
  591.      
  592.      When this is cleaned up, it will support growing boxes, more borders,
  593.      and support full 1,1,80,24... dimensions....
  594.      
  595.      p.s. ZMakeWindowG uses the same operands but draws a window a bit
  596.      different!
  597. ZRoutine Documentation                                          January 14, 1989
  598. Version 1.1                                                              Page 20
  599.  
  600.  
  601.     _________________________________________________________________________
  602.  
  603.        ZPad - Pad a string to a specified length Function ZPad (A_string,
  604.      Pad_string : string; TotalLength: Integer) : string;
  605.      
  606.      This function will pad a string to the length of TotalLength.
  607.      
  608.      
  609.      Example:
  610.      
  611.      (* Pad the heading with dashes across the page *)
  612.      
  613.      Heading := ZPad('Zroutine documentation','-',80);
  614.      
  615.      Will produce
  616.      
  617.      Zroutine documentation-------------------------------------------
  618.      thru column 80.
  619. ZRoutine Documentation                                          January 14, 1989
  620. Version 1.1                                                              Page 21
  621.  
  622.  
  623.     _________________________________________________________________________
  624.  
  625.                           ZPress_Any_Key_To_Continue ;
  626.     _________________________________________________________________________
  627.      Procedure ZPress_Any_Key_To_Continue ;
  628.      
  629.      This procedure writes the line Press any key to continue and waits for
  630.      the user to do so. There are three "features" built in.
  631.      
  632.      First, after the user presses enter, the line with Press Any Key To
  633.      Continue is erased and the cursor is placed at the first byte of the
  634.      line. This means the line is usable, not scrolled up.
  635.      
  636.      Second, a ZBEEP (2) is executed (see ZBeep in this doc). This may be
  637.      silenced with the ZSilent boolean function (also in this doc).
  638.      
  639.      Third, if the user presses ESC, the program is stopped and control
  640.      returns to the system.
  641.      
  642.      Example:
  643.      
  644.      (* Silence the beeps *)
  645.      ZSilent := False;
  646.      (* Prompt the user to press enter *)
  647.      ZPress_Any_Key_To_Continue;
  648.      
  649.      
  650. ZRoutine Documentation                                          January 14, 1989
  651. Version 1.1                                                              Page 22
  652.  
  653.  
  654.     _________________________________________________________________________
  655.  
  656.                     ZRight - Select the rightmost characters
  657.     _________________________________________________________________________
  658.      Function ZRight (A_String : string; A_Word : Word) : string;
  659.      
  660.      This function returns the right characters of a string.
  661.      
  662.      
  663.      Example:
  664.      
  665.      XYZ :=  ZRight('Bob', 2);
  666.      
  667.      XYZ is now equal to "ob".
  668.      
  669.      
  670.      XYZ :=  ZRight(abc, 1);
  671.      
  672.      XYZ is now equal to the last byte of abc...
  673.      
  674.      
  675.      Notes:
  676.      
  677.      If ZRight is told to select more than the length of the string, for
  678.      example, you request the 5 most right bytes of a 2 byte string, only
  679.      the 2 bytes are returned (equivalent to a simple assignment
  680.      statement).
  681.      
  682. ZRoutine Documentation                                          January 14, 1989
  683. Version 1.1                                                              Page 23
  684.  
  685.  
  686.     _________________________________________________________________________
  687.  
  688.                              ZShell - Shell to dos
  689.     _________________________________________________________________________
  690.      Procedure ZShell(TheCommand : string);
  691.      
  692.      This procedure shells to dos and invokes the specified command. To
  693.      shell to dos until the user specifies EXIT, use a null command
  694.      string...
  695.      
  696.      
  697.      Example:
  698.      
  699.      ZShell ('');
  700.      
  701.      Shells to dos until the user presses exit.
  702.      
  703.      ZShell ('Dir *.*');
  704.      
  705.      Shells to dos, issues the dir command and returns immediately.
  706.      
  707.      
  708.      Notes:
  709.      
  710.      Be sure to use the compiler directive $M to set the max heap size to a
  711.      low value. The default is your program uses all memory. Override this
  712.      by specifying a minimal Heap amount.
  713. ZRoutine Documentation                                          January 14, 1989
  714. Version 1.1                                                              Page 24
  715.  
  716.  
  717.     _________________________________________________________________________
  718.  
  719.                        ZSilent - Global boolean variable
  720.     _________________________________________________________________________
  721.      Var ZSilent : Boolean;
  722.      
  723.      This is a variable created and initialized to TRUE. There are many
  724.      functions within Zroutines that sound the alarm. If ZSilent is set to
  725.      FALSE, these functions will not sound the alarm.
  726.      
  727.      
  728.      
  729.      Example:
  730.      
  731.      (*   The following line turns noise off      *)
  732.      ZSilent := False;
  733.      
  734.      (*   The following line turns noise back on  *)
  735.      ZSilent := True;
  736.      
  737. ZRoutine Documentation                                          January 14, 1989
  738. Version 1.1                                                              Page 25
  739.  
  740.  
  741.     _________________________________________________________________________
  742.  
  743.                      ZStr - Returns string type of integers
  744.     _________________________________________________________________________
  745.      Function ZSTR (A_number: integer) : string;
  746.      
  747.      This function is the compliment to the STR procedure.
  748.      
  749.      
  750.      Example:
  751.      
  752.      
  753.      TheString := ZStr(3);
  754.      
  755.      
  756. ZRoutine Documentation                                          January 14, 1989
  757. Version 1.1                                                              Page 26
  758.  
  759.  
  760.     _________________________________________________________________________
  761.  
  762.        ZString - Generate a string of chars Function ZString (A_String :
  763.      string;  A_Num : Word) : string;
  764.      
  765.      This function returns a string by taking the string passed and
  766.      concatenating it to itself the A_Num of times specified.
  767.      
  768.      
  769.      Example:
  770.      
  771.      XYZ := ZString('-',50);
  772.      
  773.      will set XYZ to 50 dashes...
  774.      
  775.      XYZ := ZString('abc',100);
  776.      is an illegal function and would generate run time errors or
  777.      unpredictable results. The reason is stringing abcabcabc 100 times
  778.      creates a string longer than 255 bytes. In pascal, a string may not
  779.      exceed 255 bytes!
  780. ZRoutine Documentation                                          January 14, 1989
  781. Version 1.1                                                              Page 27
  782.  
  783.  
  784.     _________________________________________________________________________
  785.  
  786.                       ZUCASE - Set a string to upper case
  787.     _________________________________________________________________________
  788.      Function ZUcase (A_String : string) : string;
  789.      
  790.      The Pascal UPCASE function only works on "char" type data. This means
  791.      it only works on one byte at a time. Almost every time I have to set
  792.      some data to upper case, I must process a string of several bytes (not
  793.      just a single byte). ZUcase processes an entire string just like
  794.      UPCASE...
  795.      
  796.      
  797.      Examples:
  798.      
  799.      
  800.      (*  Set the chars xyz to upper case     *)
  801.      NewString := ZUcase('xyz');
  802.      
  803.      (*  Set the value of Name to upper case *)
  804.      NewString := ZUcase(Name);
  805.      
  806.      (*  Using ZCmd from these routines, set the command line to
  807.          upper case                          *)
  808.      
  809.      ZCmd := ZUcase(ZCmd);
  810. ZRoutine Documentation                                          January 14, 1989
  811. Version 1.1                                                              Page 28
  812.  
  813.  
  814.     _________________________________________________________________________
  815.  
  816.                     ZWrite - Write a string to a screen area
  817.     _________________________________________________________________________
  818.      Procedure ZWrite (x,y : integer ; A_String);
  819.      
  820.      Writes the given string at the x,y co-ordinates.
  821.      
  822.      
  823.      Example:
  824.      
  825.      ZWrite (24,1,'This is the bottom of the screen');
  826.      
  827.      Will generate that line at row 24, column 1.
  828.                                         
  829.  
  830.  
  831.  
  832.  
  833.  
  834.      Introduction...............................................1
  835.      Printing this document.....................................2
  836.      ZBeep
  837.          - Sound a beep "x" number of times.....................3
  838.      ZCmd
  839.          - Global string variable...............................4
  840.      ZCmdInt
  841.          - returns a command line integer.......................5
  842.      ZCmdKeyWord
  843.          - Checks for keyword on command line...................6
  844.      ZCmdPos
  845.          - Get the positional parameter.........................7
  846.      ZCmdStr
  847.          - return command line parameter........................8
  848.      ZColor
  849.          - Set Text color.......................................9
  850.      ZCsr
  851.          Procedures - modify Cursor Attributes
  852.          ZCsrNone..............................................10
  853.          ZCsrBlock.............................................10
  854.          ZCsrNormal............................................10
  855.          ZCsrHalf..............................................10
  856.          ZCsrSize(x,y).........................................10
  857.      ZLPadInt
  858.          - Generate leading zeros..............................11
  859.      ZInput
  860.          - Formatted Input Routine.............................12
  861.      ZIO - I/O Error routines
  862.          ZIOCheck - Did an IO error occur......................14
  863.          ZIOErr - Global variable..............................15
  864.          ZIOResult - Check IOResult............................16
  865.          ZIOVerify - Verify the previous IO worked.............17
  866.      ZLTrim
  867.          - Trim leading spaces.................................18
  868.      ZMakeWindow
  869.          - Generate a window...................................19
  870.      ZPad
  871.          - Pad a string to a specified length..................20
  872.      ZPress_Any_Key_To_Continue................................21
  873.      ZRight
  874.          - Select the rightmost characters.....................22
  875.      ZShell
  876.          - Shell to dos........................................23
  877.      ZSilent
  878.          - Global boolean variable.............................24
  879.      ZStr
  880.          - Returns string type of integers.....................25
  881.      ZString
  882.          - Generate a string of chars..........................26
  883.      ZUCASE
  884.          - Set a string to upper case..........................27
  885.      ZWrite
  886.          - Write a string to a screen area.....................28
  887.