home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / DMSERROR.ZIP / DMSOOPS.DOC < prev    next >
Encoding:
Text File  |  1988-09-17  |  18.0 KB  |  599 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.                                    DMSOOPS
  27.  
  28.                      An error display utility for Clipper S'87
  29.  
  30.  
  31.  
  32.                                     v.1.10
  33.                                   Bob Laszko
  34.                               September 15, 1988
  35.  
  36.  
  37.                                 Copyright 1988
  38.                             Data Management Systems
  39.                               All rights reserved
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.          INTRODUCTION
  74.  
  75.               DMSOOPS.PRG is the result of a design specification to
  76.          allow uniform and consistent display of error / erroneous
  77.          conditions. It consists of a "dialog" box with a title,
  78.          message lines, and an instruction area for user input.
  79.  
  80.               Bells and whistles were added to DMSOOPS to enhance to
  81.          its appeal to both users and the Clipper development
  82.          community. These include an option to identify the region of
  83.          the screen to put the DMSOOPS message box, designate frame
  84.          characters, shadowing (left & right w/choice of character),
  85.          and an exploding box. Each option is fully documented below.
  86.          Examination of the source code will also reveal some of the
  87.          inner workings of this routine.
  88.  
  89.  
  90.          LEGAL, RIGHTS, & OTHER STUFF
  91.  
  92.               DMSOOPS, as distributed in it's present form, is a
  93.          copyrighted product. It is not released into the public domain.
  94.          Data Management Systems reserves all rights to DMSOOPS as
  95.          provided by US Copyright laws. You may use DMSOOPS in your
  96.          applications, both personal and commercial, without royalty
  97.          obligations.
  98.  
  99.               Although a great deal of time and effort have been spent
  100.          designing, coding and debugging this utility, it cannot be
  101.          certain that it is totally error free. It should be clearly
  102.          understood that DMSOOPS is released "as is". Data Management
  103.          Systems makes no warranties, expressed nor implied, of
  104.          merchantability and fitness for a particular purpose. In no
  105.          event shall Data Management Systems be liable for any direct,
  106.          indirect, or consequential damages, real or imagined.
  107.  
  108.  
  109.          CALLING DMSOOPS
  110.  
  111.               The syntax for calling DMSOOPS with all options as
  112.          parameters in the command line is as follows:
  113.  
  114.               DO DMSOOPS WITH title, frame, instruction, location,;
  115.                          rest_scrn, explode, implode, shad_show,;
  116.                          shad_char, shad_side
  117.  
  118.               It should be noted that every parameter is optional. You
  119.          must maintain the order of the parameters as shown, however,
  120.          and include all parameters to the left. Let's say for example
  121.          that you wish to specify a custom location - you must also
  122.          provide the title, frame, and instruction parameters as well.
  123.  
  124.  
  125.  
  126.  
  127.  
  128. ────────────────────────────────────────────────────────────────────────────────
  129. DMSOOPS v.1.10       Copyright 1988 Data Management Systems               - 1 -
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.               You can also declare any of the options you wish to
  139.          change (from their defaults) in the calling program and call
  140.          DMSOOPS without any parameters in the command line, as shown
  141.          in the example below:
  142.  
  143.               title = "Printer Not Ready"
  144.               location = "UL"
  145.               DO DMSOOPS
  146.  
  147.               You CANNOT mix the two styles of calling DMSOOPS. Either
  148.          include the parameters that you wish to customize in the
  149.          command line or declare them before calling DMSOOPS.
  150.  
  151.  
  152.          PARAMETERS (OPTIONS)
  153.  
  154.               title          C    title to display on top line of box
  155.                                   default = "OOPS"
  156.  
  157.               frame          N    0 = no characters in border
  158.                                   1 = single line box
  159.                                   2 = double line box
  160.                                   3 = double top/bottm, single sides
  161.                                   4 = single top/bottom, double sides
  162.                              C    custom frame, include all eight
  163.                                    characters as outlined for @...BOX
  164.                                    command
  165.                                   default = 1
  166.  
  167.               instruction    C    instructions to display on bottom
  168.                                    line of box
  169.                                   default = "Press Any Key to Continue"
  170.  
  171.               location       C    UR = upper right corner of screen
  172.                                   UL = upper left corner of screen
  173.                                   LL = lower left corner of screen
  174.                                   LR = lower right corner of screen
  175.                                   C  = center of screen
  176.                                   default = C
  177.  
  178.               rest_scrn      L    .T. = restore screen upon RETURN to
  179.                                   calling .PRG
  180.                                   .F. = screen not restored
  181.                                   default = .T.
  182.  
  183.               explode        L    .T. = exploding box
  184.                                   .F. = no explosion
  185.                                   default = .T.
  186.  
  187.               implode        L    .T. = implode screen before restore
  188.                                   .F. = no implosion
  189.                                   default = .T.
  190.                                   must explode box to implode on
  191.                                    restore
  192.  
  193.  
  194. ────────────────────────────────────────────────────────────────────────────────
  195. DMSOOPS v.1.10       Copyright 1988 Data Management Systems               - 2 -
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.               shad_show      L    .T. = shadow
  205.                                   .F. = no shadow
  206.                                   default = .T.
  207.  
  208.               shad_char      C    character to use for shadow
  209.                                   default = CHR(177) "▒"
  210.               shad_side      C    L = shadow on left side of box
  211.                                   R = shadow on right side of box
  212.                                   default = R
  213.          PUBLIC MEMVARS
  214.  
  215.               The following memvars must be declared in the calling prg
  216.  
  217.               OOPS_MSG[]     C    each line of message to display in
  218.                                   box
  219.               M_COOPSFR    * C    color for box frame
  220.               M_COOPSTIT   * C    color for title
  221.               M_COOPSTXT   * C    color for messages (text)
  222.               M_COOPSINS   * C    color for instruction
  223.               M_COOPSSHD   * C    color for shadow
  224.               OOPS_SCRN    * C    screen saved prior to calling OOPS.
  225.                            *      if these memvars are not initialized
  226.                                    by the calling prg, they will
  227.                                    become PRIVATE
  228.  
  229.               The following memvars must be declared in the calling
  230.               prg, if used
  231.  
  232.               OOPS_RESP[]    C    valid responses to instruction line
  233.                                   prompts
  234.               OOPS_ACTION    C    validated response returned to
  235.                                   calling prg
  236.  
  237.           PRIVATE MEMVARS
  238.  
  239.               The following memvars are used by DMSOOPS.PRG
  240.  
  241.               OOPS_TITLE     C    title parameter
  242.               OOPS_FRAME     C    frame for box derived from frame
  243.                                   parameter
  244.               OOPS_INS       C    instruction parameter
  245.               OOPS_LEN       N    length of box
  246.               OOPS_TOP       N    top row of box
  247.               OOPS_LEFT      N    left column of box
  248.               OOPS_BOTT      N    bottom row of box
  249.               OOPS_RIGHT     N    right column of box
  250.               EXP_TOP        N    top row of exploding box
  251.               EXP_LEFT       N    left column of exploding box
  252.               EXP_BOTT       N    bottom row of exploding box
  253.               EXP_RIGHT      N    right column of exploding box
  254.               LIMIT_TOP      N    lowest value allowed for OOPS_TOP
  255.               LIMIT_LEFT     N    lowest value allowed for OOPS_LEFT
  256.               LIMIT_BOTT     N    highest value allowed for OOPS_BOTT
  257.               LIMIT_RIGHT    N    highest value allowed for OOPS_RIGHT
  258.               MSG[]          C    OOPS_MSG[] used in this routine
  259.  
  260. ────────────────────────────────────────────────────────────────────────────────
  261. DMSOOPS v.1.10       Copyright 1988 Data Management Systems               - 3 -
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.               MSG_NO         N    # of messages (LEN(OOPS_MSG))
  271.               MSG_LEN        N    length of messages
  272.               EXP_SCRN[]     C    screens of each step of exploding box
  273.               EXP_NO         N    # of steps in exploding box
  274.               T_EXP_NO       N    temp used to find EXP_NO
  275.               COL_POS        N    current column for @...SAY
  276.               ROW_POS        N    current row for @...SAY
  277.               ADJUST         N    adjustment factor for COL_POS
  278.               CURR_COLOR     C    current SETCOLOR() before calling
  279.                                   DMSOOPS 
  280.               CURR_ROW       N    current cursor row before calling
  281.                                   DMSOOPS
  282.               CURR_COL       N    current cursor column before calling
  283.                                   DMSOOPS
  284.               CURR_CURSOR    L    current cursor on/off state before
  285.                                   calling DMSOOPS
  286.               VALID_RESP     N    flag to validate OOPS_INS[]
  287.               ACTION         N    INKEY(0) for OOPS_INS[] validation
  288.               X              N    FOR...NEXT memvar
  289.  
  290.  
  291.          USING DMSOOPS IN YOUR APPLICATIONS
  292.  
  293.               Following are some example code fragments that use
  294.          DMSOOPS. They can be found in their entirety in the file
  295.          OOPSDEMO.PRG.
  296.  
  297.  
  298.               * DMSOOPS.PRG example #1
  299.               *
  300.               DECLARE OOPS_MSG[2]
  301.               OOPS_MSG[1] = "Printer is not ready. Make sure"
  302.               OOPS_MSG[2] = "it is on-line and has paper"
  303.  
  304.               DECLARE OOPS_RESP[2]
  305.               OOPS_RESP[1] = "R"
  306.               OOPS_RESP[2] = "A"
  307.  
  308.               OOPS_ACTION = SPACE(1)
  309.  
  310.               DO DMSOOPS WITH "Printer Not Ready", 1,;
  311.                         "R = Retry   A = Abort", "UL", .T., .T., .T.,;
  312.                         .T., "▒", "R"
  313.  
  314.               RELEASE OOPS_MSG, OOPS_RESP
  315.  
  316.               * - or -
  317.  
  318.               DECLARE OOPS_MSG[2]
  319.               OOPS_MSG[1] = "Printer is not ready. Make sure"
  320.               OOPS_MSG[2] = "it is on-line and has paper"
  321.  
  322.               DECLARE OOPS_RESP[2]
  323.  
  324.  
  325.  
  326. ────────────────────────────────────────────────────────────────────────────────
  327. DMSOOPS v.1.10       Copyright 1988 Data Management Systems               - 4 -
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.               OOPS_RESP[1] = "R"
  337.               OOPS_RESP[2] = "A"
  338.  
  339.               OOPS_ACTION = SPACE(1)
  340.  
  341.               title = "Printer Not Ready"
  342.               frame = 1
  343.               instruction = "R = Retry   A = Abort"
  344.               location = "UL"
  345.               rest_scrn = .T.
  346.               explode = .T.
  347.               implode = .T.
  348.               shad_show = .T.
  349.               shad_char = "▒"
  350.               shad_side = "R"
  351.  
  352.               DO DMSOOPS
  353.  
  354.               RELEASE OOPS_MSG, OOPS_RESP, title, frame, instruction
  355.               RELEASE location, rest_scrn, explode, implode, shad_show
  356.               RELEASE shad_char, shad_side
  357.  
  358.               * - either results in:
  359.  
  360.                    ┌──────[ Printer Not Ready ]──────┐
  361.                    │                                 │▒▒
  362.                    │ Printer is not ready. Make sure │▒▒
  363.                    │ it is on-line and has paper     │▒▒
  364.                    │                                 │▒▒
  365.                    └────[ R = Retry   A = Abort ]────┘▒▒
  366.                     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  367.  
  368.  
  369.               * DMSOOPS.PRG example #2
  370.               *
  371.               DECLARE OOPS_MSG[2]
  372.               OOPS_MSG[1] = "Customer John Smith"
  373.               OOPS_MSG[2] = "does not exist."
  374.  
  375.               DECLARE OOPS_RESP[2]
  376.               OOPS_RESP[1] = "Y"
  377.               OOPS_RESP[2] = "N"
  378.  
  379.               OOPS_ACTION = SPACE(1)
  380.  
  381.               instruction = "Add ?  Y = Yes   N = No"
  382.               shad_show = .F.
  383.  
  384.               DO DMSOOPS
  385.  
  386.               RELEASE OOPS_MSG, OOPS_RESP, instruction, shad_show
  387.  
  388.  
  389.  
  390.  
  391.  
  392. ────────────────────────────────────────────────────────────────────────────────
  393. DMSOOPS v.1.10       Copyright 1988 Data Management Systems               - 5 -
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.               * - results in:
  403.  
  404.                    ┌───────────[ OOPS ]──────────┐
  405.                    │                             │
  406.                    │     Customer John Smith     │
  407.                    │     does not exist          │
  408.                    │                             │
  409.                    └─[ Add ?  Y = Yes   N = No ]─┘
  410.  
  411.  
  412.               * DMSOOPS.PRG example #3
  413.               *
  414.               DECLARE OOPS_MSG[2]
  415.               OOPS_MSG[1] = "This customer has sales"
  416.               OOPS_MSG[2] = "Cannot delete at this time"
  417.  
  418.               DO DMSOOPS
  419.               RELEASE OOPS_MSG
  420.  
  421.               * - results in:
  422.  
  423.                    ┌───────────[ OOPS ]──────────┐
  424.                    │                             │▒▒
  425.                    │ This customer has sales     │▒▒
  426.                    │ Cannot delete at this time  │▒▒
  427.                    │                             │▒▒
  428.                    └[ Press Any Key to Continue ]┘▒▒
  429.                     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  430.  
  431.  
  432.          MODIFYING DEFAULTS
  433.  
  434.               Some defaults have been coded to our needs. Following is
  435.          a list of memvars that you may want to modify to suit yours.
  436.  
  437.               LIMIT_TOP, LIMIT_LEFT, LIMIT_BOTT, LIMIT_RIGHT - these
  438.          represent the outside limits for the box to display in. We
  439.          use full screen borders in all our applications. Modify these
  440.          to taste.
  441.  
  442.               M_COOPSFR, M_COOPSTIT, M_COOPSTXT, M_COOPSINS,
  443.          M_COOPSSHD - these are the colors for the various parts of
  444.          the box. We use M_ for all "permanent" memvars, C represents
  445.          Color.
  446.  
  447.  
  448.          ERROR TRAPPING
  449.  
  450.               There is no error trapping code in this routine. Any
  451.          un-initialized options are assigned default values beginning
  452.          at line 177. The adventurous among you could add error
  453.          trapping code and conceivably call DMSOOPS to display the
  454.          error.
  455.  
  456.  
  457.  
  458. ────────────────────────────────────────────────────────────────────────────────
  459. DMSOOPS v.1.10       Copyright 1988 Data Management Systems               - 6 -
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.          COMPILING & LINKING
  469.  
  470.               You can keep DMSOOPS.PRG as a stand-alone file to be
  471.          compiled along with your other files, or you can include it
  472.          in your standard tool-box procedure file. To do this, remove
  473.          the ** in line 162. The examples below assume DMSOOPS.PRG is
  474.          used as a stand-alone file, called from OOPSDEMO.PRG
  475.  
  476.               Compile with Clipper
  477.  
  478.                     CLIPPER OOPSDEMO -l
  479.               To link with PLINK86:
  480.  
  481.                    PLINK86 FILE OOPSDEMO, EXXTEND LIB CLIPPER, EXTEND
  482.  
  483.               To link with TLINK:
  484.  
  485.                    TLINK OOPSDEMO EXXTEND,,,CLIPPER EXTEND
  486.  
  487.  
  488.          EXXTEND.OBJ
  489.  
  490.               EXXTEND.OBJ includes functions that return the current
  491.          state of many of Clipper's set commands. Written by J. Scott
  492.          Emerich, these functions have become a standard part of our
  493.          application toolbox and are included in DMSOOPS1.ARC. See
  494.          EXXTEND.DOC for more information.
  495.  
  496.  
  497.          REVISION HISTORY
  498.  
  499.               v.1.10 - Added check for monochrome systems in setting
  500.                        default colors.
  501.  
  502.                        Added imploding box on restore parameter.
  503.  
  504.                        Used ASCAN() function to validate OOPS_RESP[].
  505.  
  506.                        Added check for cursor on/off state, restores
  507.                        original state on exit.
  508.  
  509.                        Added save of cursor position, restore on exit
  510.  
  511.                        Corrected bug in explosion code. Exploding box
  512.                        was sometimes larger than final display box.
  513.  
  514.  
  515.          FUTURE OF DMSOOPS
  516.  
  517.               Now that we have what we feel is an excellent vehicle
  518.          for reporting errors, we will tackle the source code in
  519.          Nantucket's ERRORSYS.PRG. Some of the options added to
  520.          DMSOOPS were done so with this in mind (ie.. <rest_scrn>).
  521.          Look for this on your favorite BBS under the title of
  522.          DMSERROR sometime in September 1988.
  523.  
  524. ────────────────────────────────────────────────────────────────────────────────
  525. DMSOOPS v.1.10       Copyright 1988 Data Management Systems               - 7 -
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.          DATA MANAGEMENT SYSTEMS ??
  535.  
  536.               We are a custom software house located in Fallbrook,
  537.          California. Founded in 1983, our primary vehicle of
  538.          developement is Clipper. We also provide consulting,
  539.          training, data processing, hardware & software resale, and
  540.          preventive maintenance.
  541.  
  542.  
  543.               Please send any comments, suggestions, or gripes to:
  544.  
  545.               Bob Laszko
  546.               Data Management Systems
  547.               PO Box 3104
  548.               Fallbrook, Ca  92028
  549.               (619) 728-0984
  550.  
  551.  
  552.               BBS support is provided via The File Bank's Clipper
  553.          Support Conference. This is one of the premier BBS's in
  554.          Southern California with something of interest from the
  555.          novice to the guru !! It is owned and operated by Bob Laszko
  556.          (this author's father). You can reach The File Bank at
  557.          (619) 728-4318.
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590. ────────────────────────────────────────────────────────────────────────────────
  591. DMSOOPS v.1.10       Copyright 1988 Data Management Systems               - 8 -
  592.  
  593.  
  594.  
  595. ata Management Systems               - 8 -
  596.  
  597.  
  598.  
  599.