home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DMSOOPS
-
- An error display utility for Clipper S'87
-
-
-
- v.1.10
- Bob Laszko
- September 15, 1988
-
-
- Copyright 1988
- Data Management Systems
- All rights reserved
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- INTRODUCTION
-
- DMSOOPS.PRG is the result of a design specification to
- allow uniform and consistent display of error / erroneous
- conditions. It consists of a "dialog" box with a title,
- message lines, and an instruction area for user input.
-
- Bells and whistles were added to DMSOOPS to enhance to
- its appeal to both users and the Clipper development
- community. These include an option to identify the region of
- the screen to put the DMSOOPS message box, designate frame
- characters, shadowing (left & right w/choice of character),
- and an exploding box. Each option is fully documented below.
- Examination of the source code will also reveal some of the
- inner workings of this routine.
-
-
- LEGAL, RIGHTS, & OTHER STUFF
-
- DMSOOPS, as distributed in it's present form, is a
- copyrighted product. It is not released into the public domain.
- Data Management Systems reserves all rights to DMSOOPS as
- provided by US Copyright laws. You may use DMSOOPS in your
- applications, both personal and commercial, without royalty
- obligations.
-
- Although a great deal of time and effort have been spent
- designing, coding and debugging this utility, it cannot be
- certain that it is totally error free. It should be clearly
- understood that DMSOOPS is released "as is". Data Management
- Systems makes no warranties, expressed nor implied, of
- merchantability and fitness for a particular purpose. In no
- event shall Data Management Systems be liable for any direct,
- indirect, or consequential damages, real or imagined.
-
-
- CALLING DMSOOPS
-
- The syntax for calling DMSOOPS with all options as
- parameters in the command line is as follows:
-
- DO DMSOOPS WITH title, frame, instruction, location,;
- rest_scrn, explode, implode, shad_show,;
- shad_char, shad_side
-
- It should be noted that every parameter is optional. You
- must maintain the order of the parameters as shown, however,
- and include all parameters to the left. Let's say for example
- that you wish to specify a custom location - you must also
- provide the title, frame, and instruction parameters as well.
-
-
-
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSOOPS v.1.10 Copyright 1988 Data Management Systems - 1 -
-
-
-
-
-
-
-
-
- You can also declare any of the options you wish to
- change (from their defaults) in the calling program and call
- DMSOOPS without any parameters in the command line, as shown
- in the example below:
-
- title = "Printer Not Ready"
- location = "UL"
- DO DMSOOPS
-
- You CANNOT mix the two styles of calling DMSOOPS. Either
- include the parameters that you wish to customize in the
- command line or declare them before calling DMSOOPS.
-
-
- PARAMETERS (OPTIONS)
-
- title C title to display on top line of box
- default = "OOPS"
-
- frame N 0 = no characters in border
- 1 = single line box
- 2 = double line box
- 3 = double top/bottm, single sides
- 4 = single top/bottom, double sides
- C custom frame, include all eight
- characters as outlined for @...BOX
- command
- default = 1
-
- instruction C instructions to display on bottom
- line of box
- default = "Press Any Key to Continue"
-
- location C UR = upper right corner of screen
- UL = upper left corner of screen
- LL = lower left corner of screen
- LR = lower right corner of screen
- C = center of screen
- default = C
-
- rest_scrn L .T. = restore screen upon RETURN to
- calling .PRG
- .F. = screen not restored
- default = .T.
-
- explode L .T. = exploding box
- .F. = no explosion
- default = .T.
-
- implode L .T. = implode screen before restore
- .F. = no implosion
- default = .T.
- must explode box to implode on
- restore
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSOOPS v.1.10 Copyright 1988 Data Management Systems - 2 -
-
-
-
-
-
-
-
-
- shad_show L .T. = shadow
- .F. = no shadow
- default = .T.
-
- shad_char C character to use for shadow
- default = CHR(177) "▒"
- shad_side C L = shadow on left side of box
- R = shadow on right side of box
- default = R
- PUBLIC MEMVARS
-
- The following memvars must be declared in the calling prg
-
- OOPS_MSG[] C each line of message to display in
- box
- M_COOPSFR * C color for box frame
- M_COOPSTIT * C color for title
- M_COOPSTXT * C color for messages (text)
- M_COOPSINS * C color for instruction
- M_COOPSSHD * C color for shadow
- OOPS_SCRN * C screen saved prior to calling OOPS.
- * if these memvars are not initialized
- by the calling prg, they will
- become PRIVATE
-
- The following memvars must be declared in the calling
- prg, if used
-
- OOPS_RESP[] C valid responses to instruction line
- prompts
- OOPS_ACTION C validated response returned to
- calling prg
-
- PRIVATE MEMVARS
-
- The following memvars are used by DMSOOPS.PRG
-
- OOPS_TITLE C title parameter
- OOPS_FRAME C frame for box derived from frame
- parameter
- OOPS_INS C instruction parameter
- OOPS_LEN N length of box
- OOPS_TOP N top row of box
- OOPS_LEFT N left column of box
- OOPS_BOTT N bottom row of box
- OOPS_RIGHT N right column of box
- EXP_TOP N top row of exploding box
- EXP_LEFT N left column of exploding box
- EXP_BOTT N bottom row of exploding box
- EXP_RIGHT N right column of exploding box
- LIMIT_TOP N lowest value allowed for OOPS_TOP
- LIMIT_LEFT N lowest value allowed for OOPS_LEFT
- LIMIT_BOTT N highest value allowed for OOPS_BOTT
- LIMIT_RIGHT N highest value allowed for OOPS_RIGHT
- MSG[] C OOPS_MSG[] used in this routine
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSOOPS v.1.10 Copyright 1988 Data Management Systems - 3 -
-
-
-
-
-
-
-
-
- MSG_NO N # of messages (LEN(OOPS_MSG))
- MSG_LEN N length of messages
- EXP_SCRN[] C screens of each step of exploding box
- EXP_NO N # of steps in exploding box
- T_EXP_NO N temp used to find EXP_NO
- COL_POS N current column for @...SAY
- ROW_POS N current row for @...SAY
- ADJUST N adjustment factor for COL_POS
- CURR_COLOR C current SETCOLOR() before calling
- DMSOOPS
- CURR_ROW N current cursor row before calling
- DMSOOPS
- CURR_COL N current cursor column before calling
- DMSOOPS
- CURR_CURSOR L current cursor on/off state before
- calling DMSOOPS
- VALID_RESP N flag to validate OOPS_INS[]
- ACTION N INKEY(0) for OOPS_INS[] validation
- X N FOR...NEXT memvar
-
-
- USING DMSOOPS IN YOUR APPLICATIONS
-
- Following are some example code fragments that use
- DMSOOPS. They can be found in their entirety in the file
- OOPSDEMO.PRG.
-
-
- * DMSOOPS.PRG example #1
- *
- DECLARE OOPS_MSG[2]
- OOPS_MSG[1] = "Printer is not ready. Make sure"
- OOPS_MSG[2] = "it is on-line and has paper"
-
- DECLARE OOPS_RESP[2]
- OOPS_RESP[1] = "R"
- OOPS_RESP[2] = "A"
-
- OOPS_ACTION = SPACE(1)
-
- DO DMSOOPS WITH "Printer Not Ready", 1,;
- "R = Retry A = Abort", "UL", .T., .T., .T.,;
- .T., "▒", "R"
-
- RELEASE OOPS_MSG, OOPS_RESP
-
- * - or -
-
- DECLARE OOPS_MSG[2]
- OOPS_MSG[1] = "Printer is not ready. Make sure"
- OOPS_MSG[2] = "it is on-line and has paper"
-
- DECLARE OOPS_RESP[2]
-
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSOOPS v.1.10 Copyright 1988 Data Management Systems - 4 -
-
-
-
-
-
-
-
-
- OOPS_RESP[1] = "R"
- OOPS_RESP[2] = "A"
-
- OOPS_ACTION = SPACE(1)
-
- title = "Printer Not Ready"
- frame = 1
- instruction = "R = Retry A = Abort"
- location = "UL"
- rest_scrn = .T.
- explode = .T.
- implode = .T.
- shad_show = .T.
- shad_char = "▒"
- shad_side = "R"
-
- DO DMSOOPS
-
- RELEASE OOPS_MSG, OOPS_RESP, title, frame, instruction
- RELEASE location, rest_scrn, explode, implode, shad_show
- RELEASE shad_char, shad_side
-
- * - either results in:
-
- ┌──────[ Printer Not Ready ]──────┐
- │ │▒▒
- │ Printer is not ready. Make sure │▒▒
- │ it is on-line and has paper │▒▒
- │ │▒▒
- └────[ R = Retry A = Abort ]────┘▒▒
- ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
-
-
- * DMSOOPS.PRG example #2
- *
- DECLARE OOPS_MSG[2]
- OOPS_MSG[1] = "Customer John Smith"
- OOPS_MSG[2] = "does not exist."
-
- DECLARE OOPS_RESP[2]
- OOPS_RESP[1] = "Y"
- OOPS_RESP[2] = "N"
-
- OOPS_ACTION = SPACE(1)
-
- instruction = "Add ? Y = Yes N = No"
- shad_show = .F.
-
- DO DMSOOPS
-
- RELEASE OOPS_MSG, OOPS_RESP, instruction, shad_show
-
-
-
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSOOPS v.1.10 Copyright 1988 Data Management Systems - 5 -
-
-
-
-
-
-
-
-
- * - results in:
-
- ┌───────────[ OOPS ]──────────┐
- │ │
- │ Customer John Smith │
- │ does not exist │
- │ │
- └─[ Add ? Y = Yes N = No ]─┘
-
-
- * DMSOOPS.PRG example #3
- *
- DECLARE OOPS_MSG[2]
- OOPS_MSG[1] = "This customer has sales"
- OOPS_MSG[2] = "Cannot delete at this time"
-
- DO DMSOOPS
- RELEASE OOPS_MSG
-
- * - results in:
-
- ┌───────────[ OOPS ]──────────┐
- │ │▒▒
- │ This customer has sales │▒▒
- │ Cannot delete at this time │▒▒
- │ │▒▒
- └[ Press Any Key to Continue ]┘▒▒
- ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
-
-
- MODIFYING DEFAULTS
-
- Some defaults have been coded to our needs. Following is
- a list of memvars that you may want to modify to suit yours.
-
- LIMIT_TOP, LIMIT_LEFT, LIMIT_BOTT, LIMIT_RIGHT - these
- represent the outside limits for the box to display in. We
- use full screen borders in all our applications. Modify these
- to taste.
-
- M_COOPSFR, M_COOPSTIT, M_COOPSTXT, M_COOPSINS,
- M_COOPSSHD - these are the colors for the various parts of
- the box. We use M_ for all "permanent" memvars, C represents
- Color.
-
-
- ERROR TRAPPING
-
- There is no error trapping code in this routine. Any
- un-initialized options are assigned default values beginning
- at line 177. The adventurous among you could add error
- trapping code and conceivably call DMSOOPS to display the
- error.
-
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSOOPS v.1.10 Copyright 1988 Data Management Systems - 6 -
-
-
-
-
-
-
-
-
- COMPILING & LINKING
-
- You can keep DMSOOPS.PRG as a stand-alone file to be
- compiled along with your other files, or you can include it
- in your standard tool-box procedure file. To do this, remove
- the ** in line 162. The examples below assume DMSOOPS.PRG is
- used as a stand-alone file, called from OOPSDEMO.PRG
-
- Compile with Clipper
-
- CLIPPER OOPSDEMO -l
- To link with PLINK86:
-
- PLINK86 FILE OOPSDEMO, EXXTEND LIB CLIPPER, EXTEND
-
- To link with TLINK:
-
- TLINK OOPSDEMO EXXTEND,,,CLIPPER EXTEND
-
-
- EXXTEND.OBJ
-
- EXXTEND.OBJ includes functions that return the current
- state of many of Clipper's set commands. Written by J. Scott
- Emerich, these functions have become a standard part of our
- application toolbox and are included in DMSOOPS1.ARC. See
- EXXTEND.DOC for more information.
-
-
- REVISION HISTORY
-
- v.1.10 - Added check for monochrome systems in setting
- default colors.
-
- Added imploding box on restore parameter.
-
- Used ASCAN() function to validate OOPS_RESP[].
-
- Added check for cursor on/off state, restores
- original state on exit.
-
- Added save of cursor position, restore on exit
-
- Corrected bug in explosion code. Exploding box
- was sometimes larger than final display box.
-
-
- FUTURE OF DMSOOPS
-
- Now that we have what we feel is an excellent vehicle
- for reporting errors, we will tackle the source code in
- Nantucket's ERRORSYS.PRG. Some of the options added to
- DMSOOPS were done so with this in mind (ie.. <rest_scrn>).
- Look for this on your favorite BBS under the title of
- DMSERROR sometime in September 1988.
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSOOPS v.1.10 Copyright 1988 Data Management Systems - 7 -
-
-
-
-
-
-
-
-
- DATA MANAGEMENT SYSTEMS ??
-
- We are a custom software house located in Fallbrook,
- California. Founded in 1983, our primary vehicle of
- developement is Clipper. We also provide consulting,
- training, data processing, hardware & software resale, and
- preventive maintenance.
-
-
- Please send any comments, suggestions, or gripes to:
-
- Bob Laszko
- Data Management Systems
- PO Box 3104
- Fallbrook, Ca 92028
- (619) 728-0984
-
-
- BBS support is provided via The File Bank's Clipper
- Support Conference. This is one of the premier BBS's in
- Southern California with something of interest from the
- novice to the guru !! It is owned and operated by Bob Laszko
- (this author's father). You can reach The File Bank at
- (619) 728-4318.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSOOPS v.1.10 Copyright 1988 Data Management Systems - 8 -
-
-
-
- ata Management Systems - 8 -
-
-
-