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