home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / CROSSBAS.ZIP / MONITOR.DOC < prev   
Encoding:
Text File  |  1982-12-04  |  53.9 KB  |  1,971 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                               Computerenergy's MONITOR
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                      Version 1.0
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.                                  PROPRIETARY NOTICE
  45.  
  46.  
  47.      MONITOR is a  proprietary  product  developed  by  Richard C.   Bemis  and
  48.      distributed by Computerenergy Corporation, Denver, Colorado.  
  49.  
  50.      Copyright 1982  by Richard  C.  Bemis and Computerenergy Corporation.  All
  51.      rights  reserved except  those expressly  granted to the user within  this
  52.      document.  
  53.  
  54.      Computerenergy Corporation,  PO Box  6267, Denver, CO 80206 (303) 233-9118
  55.      Source: ST6070 
  56.  
  57.  
  58.  
  59.  
  60.                                         - i -
  61.  
  62.  
  63.  
  64.                                   TABLE OF CONTENTS
  65.  
  66.      Section                                                               Page
  67.  
  68.  
  69.  
  70.      CHAPTER 1  MONITOR DISTRIBUTION NOTICE ...............................   1
  71.  
  72.      CHAPTER 2  INTRODUCTION AND SETUP ....................................   2
  73.         2.1  Use Restrictions .............................................   2
  74.         2.2  This Document ................................................   2
  75.         2.3  Setup and Use ................................................   2
  76.         2.4  Color Video Board Notes ......................................   3
  77.  
  78.      CHAPTER 3  GENERAL INSTRUCTIONS ......................................   4
  79.         3.1  Program Interface to the Routines ............................   4
  80.         3.2  Returned Data ................................................   5
  81.         3.3  Return Codes .................................................   5
  82.         3.4  Returned Values ..............................................   5
  83.         3.5  Routine Interface Procedure ..................................   5
  84.         3.6  Routine Names ................................................   5
  85.         3.7  Reserved Variables ...........................................   5
  86.  
  87.      CHAPTER 4  ROUTINE SUMMARY - BY NUMBER ...............................   6
  88.  
  89.      CHAPTER 5  ROUTINE SUMMARY - BY TYPE .................................   7
  90.  
  91.      CHAPTER 6  INPUT/OUTPUT ROUTINES .....................................   8
  92.         6.1  No. 1 - Data Entry - ZIN .....................................   8
  93.         6.2  No. 2 - Menu & "Enter Code" - ZMENU ..........................  12
  94.         6.3  No. 3 - Clear Target Area - ZTCLR ............................  14
  95.         6.4  No. 4 - Menu w/Targets for Data - ZTMENU .....................  15
  96.         6.5  No. 5 - Update Menu with Data - ZUPTMENU .....................  17
  97.         6.6  No. 6 - Boxed Title - ZBOX ...................................  18
  98.         6.7  No. 7 - Single-Line Page Heading - ZLINE .....................  19
  99.         6.8  No. 8 - All ok? - ZAOK .......................................  20
  100.  
  101.      CHAPTER 7  EDIT ROUTINES .............................................  21
  102.         7.1  No. 9 - Test for Y or N - ZTESTYN ............................  21
  103.         7.2  No. 10 - Numeric Limit Test - ZNLIMIT ........................  22
  104.  
  105.      CHAPTER 8  OTHER ROUTINES ............................................  23
  106.         8.1  No. 11 - Clear Screen - ZSCREEN ..............................  23
  107.         8.2  No. 12 - Sound Quiet Beep - ZBEEP ............................  23
  108.         8.3  No. 13 - Convert Input to Uppercase - ZUP ....................  23
  109.         8.4  No. 14 - Convert Input to Mixed Case - ZMIX ..................  23
  110.         8.5  No. 15 - End Program - ZEND ..................................  24
  111.         8.6  No. 16 - Print Centered Message - ZCTR .......................  25
  112.         8.7  No. 17 - Print Centered Message - Reverse Video - ZCTRR ......  25
  113.         8.8  No. 18 - Print Centered Message - Blinking - ZCTRB ...........  25
  114.         8.9  No. 19 - Print Centered Message - Underlined - ZCTRU .........  25
  115.  
  116.      CHAPTER 9  ERROR MESSAGES ............................................  26
  117.         9.1  No. 20-26 - Error Messages - ZERRname ........................  26
  118.  
  119.  
  120.  
  121.                                        - ii -
  122.  
  123.  
  124.  
  125.                                   TABLE OF CONTENTS
  126.  
  127.      Section                                                               Page
  128.  
  129.  
  130.      CHAPTER 10  MONITOR LINE USAGE MAP/SPECIAL VARIABLES .................  27
  131.         10.1  Monitor Line Number Usage Map ...............................  27
  132.         10.2  Special Variables ...........................................  27
  133.  
  134.      CHAPTER 11  STANDALONE ROUTINES ......................................  28
  135.         11.1  Save Program Routine ........................................  28
  136.         11.2  Program Memory Map ..........................................  28
  137.  
  138.      CHAPTER 12  OTHER INFORMATION ........................................  29
  139.         12.1  Distribution Disk Contents - Monitor ........................  29
  140.         12.2  Disclaimer ..................................................  29
  141.  
  142.      CHAPTER 13  SUGGESTIONS, FEEDBACK, AND BUG REPORTS ...................  30
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.      Monitor                          - iii -        Computerenergy Corporation
  183.  
  184.  
  185.  
  186.                                       CHAPTER 1
  187.  
  188.                              MONITOR DISTRIBUTION NOTICE
  189.  
  190.      Monitor is being  distributed using the "Freeware"* approach.  To those of
  191.      you  unfamiliar  with  this approach,  it works  like  this.  You may send
  192.      either a preformatted single-sided disk (or a prepaid contribution for our
  193.      disk  and mailer)  to us  with a prepaid return mailer  and we will send a
  194.      complete copy  of the  product.  If the product does  not meet your needs,
  195.      please pay  nothing.  If the product does meet your needs, and you can use
  196.      it, then  we  would  appreciate  a  contribution of  whatever  you feel is
  197.      appropriate.   Naturally,  we have  probably given  you  a clue in several
  198.      places  as  to  what  is  our  "completely  unprejudiced  opinion"  of  an
  199.      appropriate  contribution amount.   Contributions are completely voluntary
  200.      and much encouraged.  
  201.  
  202.      Even if you do  not contribute, you are encouraged  to copy and distribute
  203.      the product freely subject to the following restrictions: 
  204.  
  205.           1. Do  not  distribute altered  copies.  Note:  You  may distribute a
  206.              separate  set of  modifications to  merge in if you wish  but they
  207.              must be clearly identified as not originating from Computerenergy.
  208.              If  you do  make modifications,  we would like to see  what you've
  209.              done, if possible, for future versions.  
  210.  
  211.           2. The product is to be distributed as a complete "distribution copy"
  212.              produced by  the copy  utility provided with the product  for this
  213.              purpose.  
  214.  
  215.           3. No fee  is to  be charged for copying or  distributing the program
  216.              without   an   express   written  agreement   with  Computerenergy
  217.              Corporation.  
  218.  
  219.           4. Commercial sale  of  this  product  in  any manner  is  prohibited
  220.              without  Computerenergy's written  permission.  Some products will
  221.              be released with this permission automatically given and expressly
  222.              stated.  
  223.  
  224.      User Groups/Clubs:  Computerenergy's freeware  products may be distributed
  225.      by Clubs and  User Groups subject to the  same restrictions.  We would ask
  226.      only that contributions  to our continuing efforts be  encouraged by those
  227.      performing such distribution.  
  228.  
  229.      Computer Bulletin  Boards:   Computerenergy's  freeware  products  may  be
  230.      distributed  by BBS's  subject to  the  same restrictions and contribution
  231.      encouragement.  However, as  the products tend to be  large and consist of
  232.      several files, we have some concern as to the reliability of transmissions
  233.      and  length of  connect time.   Perhaps disks could be mailed  or just the
  234.      documentation placed on the board for browsers.  
  235.  
  236.  
  237.      * The Freeware  concept was  initially developed by Andrew Fluegelman  and
  238.      the  term  "FREEWARE"  is a  trademark of  The  Headlands Press, Inc.  The
  239.      Headlands Press  provides a catalog of information about Freeware products
  240.      available  from multiple  sources.  They  may be contacted at PO  Box 862,
  241.      Tiburon, CA 94920 or Source: TCP204 or Compuserve: 71435,1235.  
  242.  
  243.      Monitor                           - 1 -         Computerenergy Corporation
  244.  
  245.  
  246.  
  247.                                       CHAPTER 2
  248.  
  249.                                INTRODUCTION AND SETUP
  250.  
  251.  
  252.      Computerenergy's Monitor is a series of routines that provide a consistant
  253.      user  interface  for  application  development.   It  helps  minimize  the
  254.      drudgery of  screen development, menus, titles, prompts, and editing input
  255.      as  the  user  interacts with  your application.   Monitor's  routines are
  256.      designed to be incorporated as a "front end" into application programs and
  257.      were created to make custom application development easier.  
  258.  
  259.      Monitor has been  developed in various forms for a number of microcomputer
  260.      basics  over  the past  several  years.   It  has  been used  for  serious
  261.      application development for all of that time by a number of developers and
  262.      now represents our consensus of the best standard set of useful routines. 
  263.  
  264.      However, we have  noticed that each developer has his own biases as to how
  265.      things should  be accomplished and variations to Monitor frequently occur.
  266.      You are  encouraged to alter Monitor in any way for your own use.  What is
  267.      important is that you use or develop a standard set of routines so that as
  268.      you develop  applications,  there  is  a  consistant user  appearance  and
  269.      function.  
  270.  
  271.      2.1  Use Restrictions
  272.  
  273.           There are no restrictions  on the incorporation of Monitor  or any of
  274.           its  routines into  any application  system or program.  There is  no
  275.           royalty or notice  required of the source of  the routines.  The sole
  276.           restriction is  that  the  Monitor  is  subject to  the  distribution
  277.           requirements stated in the Distribution Notice when it is distributed
  278.           as Monitor itself.  
  279.  
  280.      2.2  This Document
  281.  
  282.           This document  is   organized  by  routine  with  detailed  reference
  283.           information on  each routine  in a separate section.  Several  screen
  284.           images  have been  included as  examples and are at the  beginning of
  285.           their sections between  lines of equal signs.  In  addition, there is
  286.           routine  summary  information which  you may  wish  to copy for quick
  287.           reference.  
  288.  
  289.      2.3  Setup and Use
  290.  
  291.           At first blush,  the Monitor  routines may appear complex and  overly
  292.           large.  However, we ask that you be patient and try incorporating the
  293.           routines as  a front  end to some of the  programs you develop.  With
  294.           use, the  routines and their structures will become second nature and
  295.           you  will  be  able to  develop code  faster  with substantially more
  296.           function and a consistant user interface.  
  297.  
  298.           We would  also  recommend  that  you  run  the  Monitor  through  our
  299.           Expanding Lister (if it is available) in order to better see what the
  300.           code  is  doing.   The Lister  should print  around  16 pages for the
  301.           Monitor.  File  this copy for later reference.  When you subsequently
  302.           use  the Lister  on a  program incorporating the Monitor, start  with
  303.  
  304.      Monitor                           - 2 -         Computerenergy Corporation
  305.  
  306.  
  307.  
  308.                                               CHAPTER 2: INTRODUCTION AND SETUP
  309.  
  310.  
  311.           line 10000 as it will save reprinting those 16 pages.  
  312.  
  313.           Before proceeding, it  is  highly  recommended  that  a copy  of  the
  314.           distribution  disk  be  made immediately  for your  use  and that the
  315.           original distribution disk be filed in a safe place.  
  316.  
  317.           The Monitor is  supplied in  Basic encoded source (.BAS) that  can be
  318.           loaded into into Basic when entering entire programs.  It may also be
  319.           convenient to  save a  version in ASCII (.S) form  that can be merged
  320.           with any application program.  
  321.  
  322.           Monitor also contains  a significant number of single-line REMarks to
  323.           aid in modification - these may be removed to save space if required.
  324.  
  325.           Some routines may not apply for a given program and may be deleted to
  326.           save space.   Shorter versions of Monitor that eliminate the targeted
  327.           menus and some of the lesser used error messages are common.  
  328.  
  329.           Monitor routines may be operated and tested in an interactive mode by
  330.           entering the  routine-calling code  after line number 10000 and  then
  331.           "running"  Monitor.  We  suggest you  give them a try as  you proceed
  332.           through this document.  
  333.  
  334.      2.4  Color Video Board Notes
  335.  
  336.  
  337.           If you are  going to  be using the Color Video  Interface rather than
  338.           the Monochrome  (green) interface, you will need to change 2 lines of
  339.           code in the Monitor as otherwise the cursor will seem to disappear.  
  340.  
  341.                Change line 1155:
  342.                          from:  1155 ZINS%=1:LOCATE ,,,4,12:RETURN
  343.                            to:  1155 ZINS%=1:LOCATE ,,,0,7:RETURN
  344.  
  345.                Change line 1165:
  346.                          from:  1165 ZINS%=0:LOCATE ,,,11,12:RETURN
  347.                            to:  1165 ZINS%=0:LOCATE ,,,6,7:RETURN
  348.  
  349.           We will add some code to make this automatic at a later time.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.      Monitor                           - 3 -         Computerenergy Corporation
  366.  
  367.  
  368.  
  369.                                       CHAPTER 3
  370.  
  371.                                 GENERAL INSTRUCTIONS
  372.  
  373.  
  374.      Video-based computer systems  have the  advantage of very quick and  quiet
  375.      response to a user.  This allows the user to interact with the computer at
  376.      basically  their own  speed.  Applications  can and should be designed  to
  377.      take advantage of these characteristics.  
  378.  
  379.      The Monitor is a series of CRT-oriented routines that provide a convenient
  380.      base for application  development.  Routines are supplied for  many of the
  381.      most common operations in the following areas: 
  382.  
  383.                               Input
  384.                               CRT Output
  385.                               Data Editing
  386.                               CRT Management
  387.                               Error Messages
  388.                               End Program - Common Exit
  389.  
  390.      Monitor is designed  to be  incorporated as a front-end into  each program
  391.      that  requests  input  from a  user.  The  application  program is usually
  392.      constructed  by  using BASIC  to  call  in  a  copy of  Monitor  (via LOAD
  393.      "MONITOR" or LOAD "MONITOR.S") and performing the following steps: 
  394.  
  395.           1. Modify the REM at statement 10 to reflect the application
  396.                program name.
  397.           2. Place the application's title in the ZTITLE$= statement
  398.           3. Modify the END at statement 25 to link to another program
  399.                if necessary
  400.           4. Enter the application's code (via Basic) beginning at the supplied
  401.                statement: 10000 REM Begin Program Here
  402.           5. Save the program with a NEW NAME
  403.  
  404.  
  405.      Notes: Some  functions  use  graphic  characters  that are  not reproduced
  406.      exactly in this manual.  
  407.  
  408.      The "ENTER" key is the large key with a "down and left" arrow on it to the
  409.      right  of  the keyboard.   This key  will be referred to as  the ENTER key
  410.      within this manual.  
  411.  
  412.      3.1  Program Interface to the Routines
  413.  
  414.           The program  interface  is  similar  for  all the  routines.  Several
  415.           variables may be loaded with information to be passed to the routine,
  416.           and the  routine is  then called by setting Z=  to the routine number
  417.           and executing a GOSUB 100.  
  418.  
  419.           Example:
  420.  
  421.               10010 Z$="Information to be passed to the routine":Z=1:GOSUB 100
  422.  
  423.  
  424.           The most  common  calling  procedure is  to first  load  any required
  425.  
  426.      Monitor                           - 4 -         Computerenergy Corporation
  427.  
  428.  
  429.  
  430.                                                 CHAPTER 3: GENERAL INSTRUCTIONS
  431.  
  432.  
  433.           variables (usually  Z$), set Z= to the routine number, and then issue
  434.           a GOSUB 100.   Most of the time this  can be accomplished on a single
  435.           line.  
  436.  
  437.      3.2  Returned Data
  438.  
  439.           Data, if any, is returned from a routine in two variables: 
  440.  
  441.                     ZD$ = Any alphanumeric data
  442.                     ZN  = Any numeric data
  443.  
  444.  
  445.      3.3  Return Codes
  446.  
  447.           Return codes  from  a  routine  (if  any)  are  provided  in the  ZR%
  448.           variable.   They   are  designed  to  communicate  the  occurance  of
  449.           different classes  of  events  to  the  programmer who  is  using the
  450.           routine.  He may then take any appropriate action he deems necessary.
  451.  
  452.  
  453.      3.4  Returned Values
  454.  
  455.           Returned Values (if  any) are returned in the ZV% variable.  Examples
  456.           of returned values can be seen in ZTESTYN and ZAOK below.  
  457.  
  458.  
  459.      3.5  Routine Interface Procedure
  460.  
  461.           To have  your   program  utilize  any  routine,  simply  follow  this
  462.           procedure: 
  463.  
  464.                1.  Load Z-prefix variables as directed in the Routine's
  465.                      format (usually Z$).
  466.                2.  Set Z equal to the Routine's Number.
  467.                3.  Execute a GOSUB 100
  468.                4.  Test Return code with "ON ZR% GOTO ...." as appropriate.
  469.                5.  Take action for each Return Code and/or Returned Value.
  470.                6.  Save returned values of ZD$ or ZN in user variables
  471.                    if appropriate.
  472.  
  473.           Many Routines will not require all of the above steps.  
  474.  
  475.      3.6  Routine Names
  476.  
  477.           For ease of communication, each Monitor Routine has been given a name
  478.           which begins with Z as a prefix.  
  479.  
  480.      3.7  Reserved Variables
  481.  
  482.           The Monitor  uses  variables that  begin with  a  "Z".  All Variables
  483.           beginning with  Z should  be reserved for use by  the Monitor and not
  484.           used within the application program.  
  485.  
  486.  
  487.      Monitor                           - 5 -         Computerenergy Corporation
  488.  
  489.  
  490.  
  491.                                       CHAPTER 4
  492.  
  493.                              ROUTINE SUMMARY - BY NUMBER
  494.  
  495.                                Monitor Quick Reference
  496.  
  497.       1   ZIN - Standard Input Routine                        
  498.       2   ZMENU - Menu and 'Enter Selection'
  499.       3   ZTCLR - Clear Target Data Fields
  500.       4   ZTMENU - Display Targeted Menu
  501.       5   ZUPTMENU - Update Targeted Menu
  502.       6   ZBOX - Boxed Title
  503.       7   ZLINE - Single Line Title
  504.       8   ZAOK - All ok?
  505.       9   ZTESTYN - Test for Y or N
  506.      10   ZNLIMIT - Numeric Limit Test
  507.      11   ZSCREEN - Erase to end of screen
  508.      12   ZBEEP - Sound Beep
  509.      13   ZUP - Convert to Uppercase
  510.      14   ZMIX - Return to Mixed Case Input
  511.      15   ZEND - Terminate Program
  512.      16   ZCTR - Center Message
  513.      17   ZCTRR - Center Mesage in Reverse Video
  514.      18   ZCTRB - Center Message - Blinking
  515.      19   ZCTRU - Center Message - Underlined
  516.      20   ZERRINV - Error Message - Invalid
  517.      21   ZERRINT - Error Message - Not Integer
  518.      22   ZERRNUM - Error Message - Not Numeric
  519.      23   ZERRCTRL - Error Message - Invalid Function
  520.      24   ZERRBACK - Error Message - Invalid Backup
  521.      25   ZERRENT - Error Message - ENTER Only
  522.      26   ZERRHELP - Error Message - Help Unavailable
  523.      29   ZDELAY - Time Delay
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.      Monitor                           - 6 -         Computerenergy Corporation
  549.  
  550.  
  551.  
  552.                                       CHAPTER 5
  553.  
  554.                               ROUTINE SUMMARY - BY TYPE
  555.  
  556.      Input/Output Routines:
  557.  
  558.           1 - ZIN      = Data Entry
  559.           2 - ZMENU    = Menu & "Enter Code"
  560.           3 - ZTCLR    = Clear Target Data Fields
  561.           4 - ZTMENU   = Menu with Targets for Data
  562.           5 - ZUPTMENU = Update Menu with Data
  563.           6 - ZBOX     = Boxed Title
  564.           7 - ZLINE    = Single-line Page Heading
  565.           8 - ZAOK     = All ok? Y or N
  566.          16 - ZCTR     = Print Centered Message
  567.          17 - ZCTRR    = Print Centered Message - reverse video
  568.          18 - ZCTRB    = Print Centered Message - blinking
  569.          19 - ZCTRU    = Print Centered Message - underlined
  570.  
  571.      Edit Routines:
  572.  
  573.            9 - ZTESTYN = Test for Y or N
  574.           10 - ZNLIMIT = Numeric Limits Test
  575.  
  576.      Other Routines:
  577.  
  578.           11 - ZSCREEN = Clear Screen
  579.           12 - ZBEEP   = Sound Beep (quiet)
  580.           13 - ZUP     = Convert Input to Uppercase
  581.           14 - ZMIX    = Convert Input to Mixed Case
  582.           29 - ZDELAY  = Time Delay
  583.  
  584.      Error Message Routines:
  585.  
  586.  
  587.           20 - ZERRINV  = "Is Invalid"
  588.           21 - ZERRINT  = "Is Not Integer"
  589.           22 - ZERRNUM  = "Is Not Numeric"
  590.           23 - ZERRCTRL = "Funvtion Key = nn Not Available at this Point"
  591.           24 - ZERRBACK = "Backup Entry Not Available at this Point"
  592.           25 - ZERRENT  = "ENTER-only Entry Not Available at this Point"
  593.           26 - ZERRHELP = "Help Not Available at this Point"
  594.  
  595.      End Program Routine:
  596.  
  597.           15 - ZEND    = End Program
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.      Monitor                           - 7 -         Computerenergy Corporation
  610.  
  611.  
  612.  
  613.                                       CHAPTER 6
  614.  
  615.                                 INPUT/OUTPUT ROUTINES
  616.  
  617.      6.1  No. 1 - Data Entry - ZIN
  618.  
  619.      ==========================================================================
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.      Prompt Message for Entry [...............]
  644.  
  645.      ==========================================================================
  646.  
  647.      ZIN provides a  general purpose  data entry capability and is  the bedrock
  648.      routine  in the  Monitor.  A  prompt message and a variable-length  target
  649.      consisting of periods  surrounded by brackets are displayed  at the bottom
  650.      left-hand  corner of  the screen  on the 23rd line.  Rudimentary  editing,
  651.      "backup to  previous entry",  and function-key options are also  provided.
  652.      Editing commands  within the  field during entry are also  supported.  The
  653.      user can not enter data outside the target, and will hear a gentle buzz if
  654.      he attempts to do so.  
  655.  
  656.      FORMAT:
  657.  
  658.           Z$ = "Prompt Message for Entry,n1,n2" : Z=1 : GOSUB 100
  659.  
  660.                n1 = Length of target field
  661.                n2 = Type of entry edit:
  662.  
  663.                     1 = Alphanumeric
  664.                     2 = Integer only
  665.                     3 = Numeric
  666.  
  667.      Note: Commas are  used as information separators, and  may not be included
  668.      in the prompt message.  
  669.  
  670.      Monitor                           - 8 -         Computerenergy Corporation
  671.  
  672.  
  673.  
  674.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  675.  
  676.  
  677.      EDITS PERFORMED:
  678.  
  679.           Type 1 (Alphanumeric):
  680.  
  681.                No editing performed.  All data is accepted as valid.
  682.  
  683.           Type 2 (Integer):
  684.  
  685.                Numeric integers only  accepted as valid.  Upon non-integer data
  686.                (ddd)  being  entered,  the  message  "ddd  Is  Not Integer"  is
  687.                displayed below the  entry line in reverse video  and the prompt
  688.                is redisplayed.  
  689.  
  690.           Type 3 (Numeric): 
  691.  
  692.                Numbers which may  be decimal, integer, and positive or negative
  693.                may be  entered.   Upon  alpha  data  (aaa) being  entered,  the
  694.                message "aaa Is  Not Numeric" is displayed below  the entry line
  695.                in reverse video and the prompt is then redisplayed.  
  696.  
  697.      RETURNS: 
  698.  
  699.           Data is contained in:
  700.  
  701.                ZD$ for Alphanumeric      (Note: string eqs. for ZN also ret'd h
  702.                ZN for Integer or Numeric
  703.  
  704.           Function-Key Number is contained in ZN if Function or Ctrl Keys were 
  705.  
  706.           Return Code in ZR%:
  707.  
  708.                ZR% = 1 = Normal entry
  709.                      2 = Up-Arrow entered or Plus entered as first character
  710.                              - Field Backup character
  711.                      3 = ENTER key was entered as first char.
  712.                      4 = Function Key or Control key was entered
  713.                      5 = Help requested
  714.  
  715.           When ZR% =  2 or 3 then ZD$ is blanked and ZN is zeroed.  This allows
  716.           an ENTER-only  response  to  be  used  to blank  out  entries without
  717.           further code.  
  718.  
  719.      EXAMPLES:
  720.  
  721.           Alphanumeric;
  722.  
  723.                10000 Z$ = "Entry Prompt,10,1" : Z=1 : GOSUB 100
  724.                10010 ON ZR% GOTO 10020,10030,10040,10050,10060
  725.                10020 PRINT "Normal Entry" : STOP
  726.                10030 PRINT "Backup Character" : STOP
  727.                10040 PRINT "ENTER Key" : STOP
  728.                10050 PRINT "Function Key" : STOP
  729.                10060 PRINT "Help Requested" : STOP
  730.  
  731.      Monitor                           - 9 -         Computerenergy Corporation
  732.  
  733.  
  734.  
  735.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  736.  
  737.  
  738.  
  739.           You may also  prevent the  user from using any of  the entry types by
  740.           merely branching  back to the prompting line with the ZR% branch.  No
  741.           error message  will be displayed.  If you wish an error message to be
  742.           displayed,  set Z  and GOSUB  100 to display the appropriate  message
  743.           (see Error Messages below) before taking the branch.  
  744.  
  745.           Example: Prohibit Backup, ENTER Key, Function Key, and Help Entry 
  746.  
  747.                     10000 Z$ = "Entry Prompt,10,1" : Z=1 : GOSUB 100
  748.                     10010 ON ZR% GOTO 10020, 10000, 10000, 10000, 10000
  749.                     10020 PRINT "Valid Data" : STOP
  750.  
  751.           By branching  to  10000, the  user is  forced to try another type  of
  752.           entry to continue processing.  
  753.  
  754.  
  755.           Function Keys: 
  756.  
  757.                Special functions may be  entered by pressing the F1  - F10 keys
  758.                or  holding down  the CTRL  key and then pressing a  letter key.
  759.                These entries (referred  to as "Functions") are trapped  by ZIN.
  760.                The corresponding number of the key pressed (A=1, B=2, C=3, etc.
  761.                and F1 - F10 = 59-68) is returned in ZN.  ZD$ is blanked.  
  762.  
  763.                Function Key Use: 
  764.  
  765.  
  766.                Example:
  767.  
  768.                          10000 Z$ = "Enter Data,10,1" : Z=1 : GOSUB 100
  769.                          10010 ON ZR% GOTO 10020, 10030, 10040, 10050, 10000
  770.                          10020 ... Normal Entry
  771.                          10030 ... Backup Character
  772.                          10040 ... ENTER Key
  773.                          10050 IF ZN > 3 THEN 10060 ELSE 10070
  774.                                    : REM Test for allowed range
  775.  
  776.                          10060 Z=23 : GOSUB 100 : GOTO 10000
  777.                                    : REM Process Range Error
  778.  
  779.                          10070 ON ZN GOTO 11000,11010,11020
  780.                          10080 STOP
  781.  
  782.                          11000 PRINT "CTRL-A was entered" : STOP
  783.                          11010 PRINT "CTRL-B was entered" : STOP
  784.                          11020 PRINT "CTRL-C was entered" : STOP
  785.  
  786.      INNER-FIELD EDITS:
  787.  
  788.           Left Arrow:    Cursor Left - non-destructive
  789.           Right Arrow:   Cursor Right - non-destructive
  790.           Backspace:     case 1: at end of field - erases 1 character
  791.  
  792.      Monitor                           - 10 -        Computerenergy Corporation
  793.  
  794.  
  795.  
  796.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  797.  
  798.  
  799.                          case 2: in middle of field - deletes character at curs
  800.           Backtab:       Cursor positioned to beginning of field
  801.           Forward Tab:   Cursor positioned to end of entered characters
  802.           INS:           Inserts blank at cursor
  803.           DEL:           Deletes character at cursor
  804.           ESC:           Erases input and restores target
  805.           Ctrl-END:      Erase from cursor to end of field
  806.  
  807.  
  808.      SPECIAL CHARACTERS:
  809.  
  810.           Up-arrow or +:      Field Backup (ENTER not required)
  811.  
  812.           ? in 1st character: Help requested (sets ZR% to 5)
  813.  
  814.           END:                If pressed twice in succession, will end program 
  815.                                   a warning message is displayed between END's
  816.  
  817.  
  818.      SPECIAL FUNCTIONS:
  819.  
  820.           Data Preloading:
  821.  
  822.                A target may be  partially or fully preloaded with  data for use
  823.                with  ZIN.  Data  may be  then  manipulated with the inner-field
  824.                edit  keys or  erased  with  ESC.   The  field to  be  loaded to
  825.                activate the preload is ZPL$.  
  826.  
  827.                ZPL$ is cleared to null after each execution of ZIN.  
  828.  
  829.      Enable/Disable Help function: 
  830.  
  831.           The Help function  may be turned on or off with ZHELPSW% at any time.
  832.           If the  Help function  is turned off, the 5th  ZR% branch need not be
  833.           specified.  
  834.  
  835.           Set ZHELPSW% =  0 to turn off.  Monitor initializes the ZHELPSW% to 1
  836.           (on) in statement 30.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.      Monitor                           - 11 -        Computerenergy Corporation
  854.  
  855.  
  856.  
  857.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  858.  
  859.  
  860.      6.2  No. 2 - Menu & "Enter Code" - ZMENU
  861.  
  862.  
  863.      ==========================================================================
  864.      Example Title                                                    10/01/82
  865.  
  866.  
  867.  
  868.  
  869.  
  870.           1 - Message for Selection 1
  871.           2 - Message for Selection 2
  872.           3 - Message for Selection 3
  873.           4 - Message for Selection 4
  874.           5 - Message for Selection 5
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.             Enter Selection [.]
  888.  
  889.  
  890.      ==========================================================================
  891.  
  892.      ZMENU provides a  menu-list display of a series of numbered options and an
  893.      "Enter Selection"  prompt.  Standard editing for Integer-only, Up-Arrow or
  894.      Plus-sign,   ENTER  Key,   Function  Key,   or   Help  key  is  performed.
  895.      Range-checking for valid selection entries is automatically provided.  
  896.  
  897.      FORMAT:
  898.  
  899.           Z$ = "n1, n2, Message-1, ...,Message-n," : Z=2 : GOSUB 100
  900.  
  901.                (Notes: Trailing comma after last message is required.
  902.                        Commas are used as separators and may not be included
  903.                          in the message.)
  904.                n1 = Row to begin menu
  905.                n2 = Column to begin menu
  906.  
  907.  
  908.      LIMITATIONS:  The maximum number of menu entries is 15.
  909.  
  910.  
  911.  
  912.  
  913.  
  914.      Monitor                           - 12 -        Computerenergy Corporation
  915.  
  916.  
  917.  
  918.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  919.  
  920.  
  921.      RETURNS:
  922.  
  923.           The Selection number is returned in ZN.  ZN is set to 0 if ZR% is not
  924.           equal 1 (= Normal Entry) 
  925.  
  926.           Return Code in ZR%: 
  927.  
  928.                     ZR% = 1 = Normal Entry
  929.                           2 = Up-Arrow entered or Plus entered as first
  930.                                character - Backup character
  931.                           3 = ENTER Key was entered as first character.
  932.                           4 = Function Key was entered.
  933.                           5 = Help - "?" entered as first character
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.      Monitor                           - 13 -        Computerenergy Corporation
  976.  
  977.  
  978.  
  979.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  980.  
  981.  
  982.      6.3  No. 3 - Clear Target Area - ZTCLR
  983.  
  984.  
  985.           ZTCLR clears   all   target  area   data  fields  (ZMENU$(1)  through
  986.           ZMENU$(15)) used  in ZTMENU and ZUPTMENU.  Each field is cleared with
  987.           a null (="").  
  988.  
  989.           FORMAT: 
  990.  
  991.                Z=3 : GOSUB 100
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.      Monitor                           - 14 -        Computerenergy Corporation
  1037.  
  1038.  
  1039.  
  1040.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  1041.  
  1042.  
  1043.      6.4  No. 4 - Menu w/Targets for Data - ZTMENU
  1044.  
  1045.  
  1046.  
  1047.      ==========================================================================
  1048.      Example Title                                                    10/01/82
  1049.  
  1050.  
  1051.       1. Prompt for Field 1                                        [.......]
  1052.       2. Prompt for Field 2                                 [..............]
  1053.       3. Prompt for Field 3                                             [..]
  1054.       4. Prompt for Field 4                    [...........................]
  1055.       5. Prompt for Field 5                               [................]
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.      ==========================================================================
  1072.  
  1073.  
  1074.      ZTMENU displays  a menu  with prompts  on the left side and  corresponding
  1075.      data   field   targets  for   entry  on   the   right.   The  approach  is
  1076.      fill-in-the-blanks with a  common entry point at the  bottom of the screen
  1077.      for each field  in turn using ZIN.  The  total centered width used for the
  1078.      display may be varied.  
  1079.  
  1080.      SET:
  1081.  
  1082.           Target data  fields  are  contained in  ZMENU$(1) through ZMENU$(15).
  1083.           These fields should be either cleared with ZTCLR or loaded with data.
  1084.           Fields which  contain data  will display the data.  Fields  which are
  1085.           empty (= "", or Null) will display targets.  
  1086.  
  1087.                ZROW% = 1st line available for menu.
  1088.                ZW%   = Width of display.
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.      Monitor                           - 15 -        Computerenergy Corporation
  1098.  
  1099.  
  1100.  
  1101.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  1102.  
  1103.  
  1104.      FORMAT:
  1105.  
  1106.           Z$ = "Prompt-n1,n1, ....Prompt-n15,n15," : Z=4 : GOSUB 100
  1107.  
  1108.                (Note: Trailing comma after last prompt is required.)
  1109.  
  1110.                Prompt-n1 - Prompt-n15 = Message for prompt
  1111.                n1 - n15   = Length of target data field
  1112.  
  1113.      LIMITATION:
  1114.  
  1115.           Maximum number of items = 15
  1116.  
  1117.  
  1118.      FUNCTION SUMMARY: 
  1119.  
  1120.           ZTMENU is used  in  conjunction  with  ZTCLR,  ZIN, and  ZUPTMENU  to
  1121.           provide a complete  set of consistant data entry  routines.  ZTMENU's
  1122.           function  is  to display  the entire  entry screen which is used  for
  1123.           feedback to  the  user.   Each  field  in turn  is  then prompted and
  1124.           entered  with  ZIN on  line 23.   As each field is properly  entered,
  1125.           ZUPTMENU is  used to display the field in the ZTMENU area.  After all
  1126.           fields have been entered and processed, ZTCLR clears the ZTMENU entry
  1127.           fields for the next set of entries.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.      Monitor                           - 16 -        Computerenergy Corporation
  1159.  
  1160.  
  1161.  
  1162.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  1163.  
  1164.  
  1165.      6.5  No. 5 - Update Menu with Data - ZUPTMENU
  1166.  
  1167.  
  1168.  
  1169.      ==========================================================================
  1170.      Example Title                                                    10/10/82
  1171.  
  1172.  
  1173.       1. Prompt for Field 1                                             100
  1174.       2. Prompt for Field 2                                  [.............]
  1175.       3. Prompt for Field 3                                            [...]
  1176.       4. Prompt for Field 4                      [.........................]
  1177.       5. Prompt for Field 5                                  [.............]
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.      ==========================================================================
  1194.  
  1195.  
  1196.  
  1197.  
  1198.      ZUPTMENU updates a line  in a targeted menu (see  ZTMENU) with data (as in
  1199.      Line No.   1 above).  The data is displayed right-justified, replacing the
  1200.      target field.  
  1201.  
  1202.      SET:
  1203.  
  1204.           ZY%    = n1  = Number of Variable (1 - 15)
  1205.           ZROW%  = n2  = Display 1st line no. on this line
  1206.                             (usually set in ZTMENU)
  1207.           ZN or ZD$    = Data to be displayed
  1208.  
  1209.      FORMAT:
  1210.  
  1211.           ZY% = n1 : ZROW% = n2 : ZN = Data or ZD$ = Data : Z=5 : GOSUB 100
  1212.  
  1213.              Note:  Data  to  be  displayed is  contained in  ZD$  or ZN.  This
  1214.                     routine  will  automatically load  the ZMENU$(ZY%) variable
  1215.                     from ZD$.  
  1216.  
  1217.  
  1218.  
  1219.      Monitor                           - 17 -        Computerenergy Corporation
  1220.  
  1221.  
  1222.  
  1223.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  1224.  
  1225.  
  1226.      6.6  No. 6 - Boxed Title - ZBOX
  1227.  
  1228.  
  1229.      ==========================================================================
  1230.      --------------------------------------------------------------------------
  1231.      |   ------------------------------------------------------------------   |
  1232.      |   |                      Example Boxed Title                       |   |
  1233.      |   ------------------------------------------------------------------   |
  1234.      --------------------------------------------------------------------------
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.      ==========================================================================
  1255.  
  1256.  
  1257.  
  1258.  
  1259.      ZBOX displays a  title within  a box as a convenient  method of program or
  1260.      section identification.  It also may be used to highlight a message.  
  1261.  
  1262.  
  1263.      FORMAT:
  1264.  
  1265.           Z$ = "Title/Message to be displayed" : Z=6 : GOSUB 100
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.      Monitor                           - 18 -        Computerenergy Corporation
  1281.  
  1282.  
  1283.  
  1284.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  1285.  
  1286.  
  1287.      6.7  No. 7 - Single-Line Page Heading - ZLINE
  1288.  
  1289.  
  1290.      ==========================================================================
  1291.      Example Title                                                    10/01/82
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.      ==========================================================================
  1316.  
  1317.  
  1318.      ZLINE provides a  compact method of titling a screen with the program name
  1319.      and  current  date.   On  the  Monochrome  interface,  the  title will  be
  1320.      underlined.  
  1321.  
  1322.      SET:
  1323.  
  1324.           ZTITLE$ = "Title to be displayed"
  1325.  
  1326.      FORMAT:
  1327.  
  1328.           Z=7 : GOSUB 100
  1329.  
  1330.      OUTPUT:
  1331.  
  1332.      Title to be Displayed                                            10/01/82
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.      Monitor                           - 19 -        Computerenergy Corporation
  1342.  
  1343.  
  1344.  
  1345.                                                CHAPTER 6: INPUT/OUTPUT ROUTINES
  1346.  
  1347.  
  1348.      6.8  No. 8 - All ok? - ZAOK
  1349.  
  1350.  
  1351.      ==========================================================================
  1352.      Example Title                                                     9/10/82
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.      All ok? Y or N [.]
  1374.  
  1375.  
  1376.      ==========================================================================
  1377.  
  1378.      ZAOK provides  a convenient  method  of  asking  for  an "All  ok?"  after
  1379.      feedback to  the user.   A typical example would be  after a review of all
  1380.      data entered  into a record up to that point.  Either Upper or Lowercase Y
  1381.      or N is accepted.  
  1382.  
  1383.  
  1384.      FORMAT:
  1385.  
  1386.           Z=8 : GOSUB 100
  1387.  
  1388.  
  1389.      RETURNS:
  1390.  
  1391.           ZR% = 1 = Data was entered
  1392.                 2 = Backup Character was entered
  1393.                 3 = ENTER Key only was entered
  1394.                 4 = Function key was entered
  1395.                 5 = Help key was entered
  1396.  
  1397.           ZV% = 1 = "Y" or "y" was entered
  1398.                 2 = "N" or "n" was entered
  1399.                 3 = something else was entered - usually an error
  1400.  
  1401.  
  1402.      Monitor                           - 20 -        Computerenergy Corporation
  1403.  
  1404.  
  1405.  
  1406.                                       CHAPTER 7
  1407.  
  1408.                                     EDIT ROUTINES
  1409.  
  1410.      7.1  No. 9 - Test for Y or N - ZTESTYN
  1411.  
  1412.  
  1413.           ZTESTYN tests for  a Y or N user response (either upper or lowercase)
  1414.           to a prompt.  
  1415.  
  1416.           SET:
  1417.  
  1418.                User response in ZD$ (automatic with ZIN and others)
  1419.  
  1420.           FORMAT:
  1421.  
  1422.                Z=9 : GOSUB 100
  1423.  
  1424.           RETURNS:
  1425.  
  1426.                Value returned in ZV%:
  1427.  
  1428.                     ZV% = 1 = "Y" or "y"
  1429.                           2 = "N" or "n"
  1430.                           3 = something else was entered - usually an error
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.      Monitor                           - 21 -        Computerenergy Corporation
  1464.  
  1465.  
  1466.  
  1467.                                                        CHAPTER 7: EDIT ROUTINES
  1468.  
  1469.  
  1470.      7.2  No. 10 - Numeric Limit Test - ZNLIMIT
  1471.  
  1472.  
  1473.           ZNLIMIT tests numeric  fields for values between high and low limits.
  1474.           ZNLIMIT  is usually  used following  a ZIN entry to further  validate
  1475.           numeric data.  
  1476.  
  1477.           SET:
  1478.  
  1479.                ZL = Low  limit
  1480.                ZH = High limit
  1481.                ZN = Data variable to be tested
  1482.  
  1483.           FORMAT:
  1484.  
  1485.                ZL = n1 : ZH = n2 : ZN = Test variable : Z=10 : GOSUB 100
  1486.  
  1487.           RETURNS:
  1488.  
  1489.                Value Returned in ZV%:
  1490.  
  1491.                     ZV% = 1 = Within limits
  1492.                           2 = Too low
  1493.                           3 = Too high
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.      Monitor                           - 22 -        Computerenergy Corporation
  1525.  
  1526.  
  1527.  
  1528.                                       CHAPTER 8
  1529.  
  1530.                                    OTHER ROUTINES
  1531.  
  1532.      8.1  No. 11 - Clear Screen - ZSCREEN
  1533.  
  1534.           ZSCREEN clears  the  screen  from the  specified line  number  to the
  1535.           bottom of the screen and places the cursor to the top blanked line.  
  1536.  
  1537.           SET:
  1538.  
  1539.                Z% = First line to be cleared.
  1540.  
  1541.           FORMAT:
  1542.  
  1543.                Z% = 3 : Z=11 : GOSUB 100
  1544.  
  1545.  
  1546.      8.2  No. 12 - Sound Quiet Beep - ZBEEP
  1547.  
  1548.  
  1549.           ZBEEP provides  a  gentle  sounding warning  buzz as  opposed  to the
  1550.           rather shrill BEEP statement in Basic.  
  1551.  
  1552.           FORMAT:
  1553.  
  1554.                Z=12 : GOSUB 100
  1555.  
  1556.  
  1557.      8.3  No. 13 - Convert Input to Uppercase - ZUP
  1558.  
  1559.           ZUP will convert  all Alpha characters that are being entered via ZIN
  1560.           routines to uppercase  independent of the shift key  on the keyboard.
  1561.           ZUP is particularly handy for Y/N answers and the like.  
  1562.  
  1563.           FORMAT:
  1564.  
  1565.                Z=13 : GOSUB 100
  1566.  
  1567.  
  1568.      8.4  No. 14 - Convert Input to Mixed Case - ZMIX
  1569.  
  1570.           ZMIX will allow  ZIN routines to accept either uppercase or lowercase
  1571.           characters without conversion.  ZMIX is normally used to reset a ZUP.
  1572.  
  1573.           FORMAT:
  1574.  
  1575.                Z=14 : GOSUB 100
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.      Monitor                           - 23 -        Computerenergy Corporation
  1586.  
  1587.  
  1588.  
  1589.                                                       CHAPTER 8: OTHER ROUTINES
  1590.  
  1591.  
  1592.      8.5  No. 15 - End Program - ZEND
  1593.  
  1594.  
  1595.  
  1596.      ==========================================================================
  1597.      --------------------------------------------------------------------------
  1598.      |  --------------------------------------------------------------------  |
  1599.      |  |                       Example Program Title                      |  |
  1600.      |  --------------------------------------------------------------------  |
  1601.      --------------------------------------------------------------------------
  1602.  
  1603.  
  1604.  
  1605.                                  -----------------
  1606.                                  |  End Program  |
  1607.                                  -----------------
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.      ==========================================================================
  1622.  
  1623.  
  1624.  
  1625.  
  1626.      ZEND will produce a  boxed title and an "End  Program" message.  ZEND also
  1627.      provides  a common  ending  point  for  programs  by always  branching  to
  1628.      statement 25.  Should you wish to chain or link to another program instead
  1629.      of ending, modify the END statement at statement 25.  
  1630.  
  1631.  
  1632.      FORMAT:
  1633.  
  1634.           Z=15 : GOSUB 100
  1635.  
  1636.  
  1637.      Note: Make  sure  the  ZTITLE$  variable  still  contains  what  you  want
  1638.      displayed in the large box.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.      Monitor                           - 24 -        Computerenergy Corporation
  1647.  
  1648.  
  1649.  
  1650.                                                       CHAPTER 8: OTHER ROUTINES
  1651.  
  1652.  
  1653.      8.6  No. 16 - Print Centered Message - ZCTR
  1654.  
  1655.  
  1656.           ZCTR will print  a centered  message on any line on  the screen.  The
  1657.           spaces on the line before and after the message are blanked.  
  1658.  
  1659.           FORMAT: 
  1660.  
  1661.                Z$ = "n1,Message" : Z=16 : GOSUB 100
  1662.  
  1663.                     n1 = Line no. for message
  1664.  
  1665.      8.7  No. 17 - Print Centered Message - Reverse Video - ZCTRR
  1666.  
  1667.  
  1668.           ZCTRR will print a  centered message in reverse video  on any line on
  1669.           the screen.  ZCTRR  is especially useful to highlight  error messages
  1670.           or warnings.  The  Monitor error routines use ZCTRR  on line 24.  The
  1671.           spaces on the line before and after the message are blanked.  
  1672.  
  1673.           FORMAT:
  1674.  
  1675.                Z$ = "n1,Message" : Z = 17 : GOSUB 100
  1676.  
  1677.                     n1 = Line no. for message
  1678.  
  1679.  
  1680.      8.8  No. 18 - Print Centered Message - Blinking - ZCTRB
  1681.  
  1682.  
  1683.           See No. 17
  1684.  
  1685.      8.9  No. 19 - Print Centered Message - Underlined - ZCTRU
  1686.  
  1687.  
  1688.           See No. 17
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.      Monitor                           - 25 -        Computerenergy Corporation
  1708.  
  1709.  
  1710.  
  1711.                                       CHAPTER 9
  1712.  
  1713.                                    ERROR MESSAGES
  1714.  
  1715.  
  1716.      9.1  No. 20-26 - Error Messages - ZERRname
  1717.  
  1718.  
  1719.           ZERRname is a convenient way to display an error message response for
  1720.           either an entry that fails a test or an invalid entry type.  
  1721.  
  1722.           The responses provided  are: "Invalid", "Not Integer", "Not Numeric",
  1723.           "Function  =  nn  Not  Available  at  this  Point",  "ENTER-Only  Not
  1724.           Available at this Point", "Backup Entry Not Available at this Point",
  1725.           and "Help Not Available at this Point".  
  1726.  
  1727.           Where appropriate,  the  value  of the  failing variable is displayed
  1728.           with  the  error messages.   The message  will  appear just below the
  1729.           entry line, centered, and in reverse video.  Each message also pauses
  1730.           for approximately 1.5 seconds.  
  1731.  
  1732.           SET: 
  1733.  
  1734.                ZD$ = Item to be shown as in error.
  1735.                          Note: Use ZCTL% for Func. Key on msg 23
  1736.  
  1737.           FORMAT:
  1738.  
  1739.                Each error routine is  called with its own number  after placing
  1740.                the offending information in ZD$ if it is not already there.  
  1741.  
  1742.                     Z = No.   Error Message
  1743.                     -------   ----------------------------------
  1744.  
  1745.                       20      "Is Invalid"
  1746.                       21      "Is Not an Integer Number"
  1747.                       22      "Is Not Numeric"
  1748.                       23      "Function Key = nn Not Available at this Point"
  1749.                       24      "Field Backup Entry Not Available at this Point"
  1750.                       25      "ENTER-Only Entry Not Available at this Point"
  1751.                       26      "HELP Not Available at this Point"
  1752.  
  1753.                The Format in all cases is:
  1754.  
  1755.                     ZD$ = N$ : Z=nn : GOSUB 100
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.      Monitor                           - 26 -        Computerenergy Corporation
  1769.  
  1770.  
  1771.  
  1772.                                      CHAPTER 10
  1773.  
  1774.                       MONITOR LINE USAGE MAP/SPECIAL VARIABLES
  1775.  
  1776.  
  1777.  
  1778.      10.1  Monitor Line Number Usage Map
  1779.  
  1780.  
  1781.            Line No.   Description
  1782.            --------   --------------------------------------------------
  1783.  
  1784.            10         REMark for Program Title and Date
  1785.            15         Insert User Program Title for Display
  1786.            25         Change END if required for linking
  1787.            30         ZHELPSW% - 0=off, 1=on
  1788.            35         Setup
  1789.            40         Soft Key Disable
  1790.            45-70      Setup
  1791.            75         ZTFAC Timing Factor
  1792.            80         ZTMENU DIM's
  1793.            90         Display Box Title and GOTO 10000
  1794.            95 - 9999  Reserved for Monitor and other products
  1795.            10000      REM Enter User Program beginning here.
  1796.  
  1797.  
  1798.  
  1799.      10.2  Special Variables
  1800.  
  1801.  
  1802.            There are  several  special  variables that  are used within Monitor
  1803.            that may be of use to you.  
  1804.  
  1805.            Variable   Description
  1806.            --------   ---------------------------------------------------------
  1807.  
  1808.            ZDT$       Stores current normalized date
  1809.            ZENT$      Carriage Return or Enter Symbol
  1810.            ZTFAC      Timing delay loop counter (change for compiled code)
  1811.            ZTOF$      Printer Top of Form
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.      Monitor                           - 27 -        Computerenergy Corporation
  1830.  
  1831.  
  1832.  
  1833.                                      CHAPTER 11
  1834.  
  1835.                                  STANDALONE ROUTINES
  1836.  
  1837.  
  1838.      There are 2  standalone  routines  available  in  Monitor for  use  during
  1839.      program development.  If  memory space is a consideration,  these routines
  1840.      should be deleted from production or final versions of your programs.  
  1841.  
  1842.  
  1843.      11.1  Save Program Routine
  1844.  
  1845.           The Save Program  Routine will  save 2 copies of your  program with a
  1846.           simple GOSUB 9000  command.  A copy is saved  in encoded Basic format
  1847.           (.BAS extension)  and in  ASCII format (.S extension) for  use by the
  1848.           Expanding  Lister, CROSSREF,  Basic Compiler, etc.  To initialize the
  1849.           routine, enter your program name in the ZPROG$ variable at line 9010.
  1850.           Then,  to save  the copies  of your program, enter a  GOSUB 9000 from
  1851.           Basic's immediate or command mode.  
  1852.  
  1853.           If you forget to initialize the ZPROG$ variable with the name of your
  1854.           program, you  will simply save a copy of "PROGNAM.NAM" on your disk -
  1855.           no harm will be done.  
  1856.  
  1857.           However, BE AWARE,  that if  you are developing a series  of programs
  1858.           and  are  using a  copy of  Monitor from another program, the  ZPROG$
  1859.           variable may  contain the  wrong program name.  Should you  forget to
  1860.           change it,  and delete  the old program lines and  add new ones, when
  1861.           you GOSUB 9000, both copies of the original program will be destroyed
  1862.           by the new program which will be saved with the old program name.  BE
  1863.           CAREFUL!  This is an easy mistake to make (speaking from experience).
  1864.  
  1865.  
  1866.      11.2  Program Memory Map
  1867.  
  1868.           There is  a  standalone  routine that  will display memory statistics
  1869.           during  program  development.  It  is accessed  with  a GOSUB 9100 in
  1870.           immediate or command mode.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.      Monitor                           - 28 -        Computerenergy Corporation
  1891.  
  1892.  
  1893.  
  1894.                                      CHAPTER 12
  1895.  
  1896.                                   OTHER INFORMATION
  1897.  
  1898.      12.1  Distribution Disk Contents - Monitor
  1899.  
  1900.  
  1901.                File Name       Description
  1902.                ------------    --------------------------------------
  1903.  
  1904.                MONITOR.BAS     MONITOR source code
  1905.                MONITOR.DOC     Documentation
  1906.  
  1907.  
  1908.      12.2  Disclaimer
  1909.  
  1910.           All Computerenergy  computer  programs are  distributed on an "as is"
  1911.           basis without warranty.  
  1912.  
  1913.           Computerenergy Corporation  and/or  any of  its program authors shall
  1914.           have no liability  or responsibility to customer or  any other person
  1915.           or  entity with  respect to  any liability, loss or damage  caused or
  1916.           alleged to be  caused directly or indirectly by  programs distributed
  1917.           in  any  manner  by  Computerenergy  Corporation,  including  but not
  1918.           limited  to   any  interruption  of  service,  loss  of  business  or
  1919.           anticipatory profits  or consequential damages resulting from the use
  1920.           or operation of such computer programs.  
  1921.  
  1922.           Note: Good data  processing procedure dictates that the user test the
  1923.           program,  run  and test  sample sets  of data, and run the  system in
  1924.           parallel  with  the  system previously  in use  for  a period of time
  1925.           adequate to  insure that results of operation of the computer program
  1926.           are satisfactory.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.      Monitor                           - 29 -        Computerenergy Corporation
  1952.  
  1953.  
  1954.  
  1955.                                      CHAPTER 13
  1956.  
  1957.                        SUGGESTIONS, FEEDBACK, AND BUG REPORTS
  1958.  
  1959.           If you  can  spare the  time, we  would  appreciate your feedback and
  1960.           suggestions  to  help  us  to  improve  the  Monitor.   As  an  added
  1961.           inducement, we will also send a free Monitor (corrected) to the first
  1962.           person   reporting   each   bug.    Immediate   family   members   of
  1963.           Computerenergy employees are NOT eligible.  Valid bugs do not include
  1964.           obvious  architectual  limitations.   If possible,  each bug reported
  1965.           should include a  short-as-possible printout of the before  and after
  1966.           bug situation with explanatory notes.  Our unprejudiced judging panel
  1967.           will  make "Bug  Awards" when  the spirit moves them and,  of course,
  1968.           their decisions are final.  
  1969.  
  1970.           We are  also aware  of some  esthetic errors when operating with  the
  1971.           color  video  interface.   Those still  remaining should be corrected
  1972.           soon, but we'd still like to hear about any you find.  
  1973.  
  1974.           Please address correspondence  to the address on the title page.  (If
  1975.           you've lost your title page, just send us a note and we'll send you a
  1976.           new one.) 
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.      Monitor                           - 30 -        Computerenergy Corporation
  2013.  
  2014.  
  2015. 
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.      Monitor