home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DMSERROR
-
- An Runtime Error System for Clipper S'87
-
-
-
- v.1.00
- Bob Laszko
- September 15, 1988
-
-
- Copyright 1988
- Data Management Systems
- All rights reserved
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- INTRODUCTION
-
- Runtime "critical" error reporting in Clipper has always
- been less than ideal. Versions prior to S'87 displayed a
- cryptic "proc:ANYPROC line:1001 Type conflict in SUBSTR
- QUIT (Q/A/I)". As developers, we could decipher this message
- (most of the time) and take the appropriate corrective
- action. But our clients would go nuts. One or two were alert
- enough to print the screen and press Q (we remembered to
- include this in our system documentation). Some would press
- A, restart the application, and wonder why it wouldn't work
- anymore. Others would call (always at 2:00 am) to tell you
- that the funny "PROC:" thing is on the screen again. Then
- there were the few that never saw the error message at all
- and rebooted their machines when "the keyboard locked up".
- What a circus !!!
-
- Clipper S'87 was supposed to alleviate this with a
- developer-definable runtime error system; and to a degree
- they succeeded. ALTERROR.PRG is great for debugging. The
- error is trapped and the debugger is called. ERRORSYS.PRG, as
- a end-user error reporting system, is worse than the older
- versions. The same "proc...line...error" message appears, but
- the application dumps unceremoniously to DOS. If your
- installations are like ours, the application was called from
- a batch file or a menu system - as soon as the application
- quits, the screen clears and the error message is gone !!
-
- The people at Nantucket probably knew that ERRORSYS was
- fairly primitive, and decided to provide the source code so
- that if we didn't like it (we don't), we could create our own
- (we did). DMSERROR is the result of our design spec for a
- runtime error system that is simple enough for the end user
- to understand, while containing all the information that the
- developer requires to indentify the problem.
-
- When an error is encountered, an error message is
- displayed via DMSOOPS. Dependent upon the error class, the
- user is given the choice of printing the error message and/or
- quitting; or attempting to correct the problem and trying
- again.
-
-
- LEGAL, RIGHTS, & OTHER STUFF
-
- DMSERROR, 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 DMSERROR as
- provided by US Copyright laws. You may use DMSERROR 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
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSERROR v.1.0 Copyright 1988 Data Management Systems - 1 -
-
-
-
-
-
-
-
-
- certain that it is totally error free. It should be clearly
- understood that DMSERROR 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.
-
-
- CLIPPER'S ERROR CLASSES
-
- There are seven classes of errors trapped by Clipper:
-
- Database
- Expression
- Miscellaneous
- Print
- Open
- Undefined
- Other
-
- DMSERROR will report only the first six error classes.
- Class Other is handled internally by Clipper without hooks to
- the Runtime Error System. Following is a discussion of how
- DMSERROR deals with each of these errors. For a more complete
- understanding of Nantucket's overall error trapping and
- reporting system it is strongly advised that you review
- appendix F, Runtime Error System, of the Clipper manual. This
- document deals solely with how DMSERROR displays and deals with
- the errors that are passed by Clipper.
-
-
- DMSERROR AS THE RUNTIME ERROR SYSTEM
-
- Database Errors
-
- Defined as occurring when any action affects a database
- between the time is is USEd and CLOSEd. Clipper passes the
- following parameters to DMSERROR:
-
- Procedure name
- Line number
- Error type
-
- A database error is considered un-recoverable by
- DMSERROR. A message is displayed and the user is given the
- choice of printing the error message and the application's
- screen where the error occurred, and / or quitting to DOS.
-
-
-
-
-
-
-
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSERROR v.1.0 Copyright 1988 Data Management Systems - 2 -
-
-
-
-
-
-
-
-
- Expression Error
-
- Defined as occurring whenever there is an evaluation of
- an expression. Clipper passes the following parameters to
- DMSERROR:
-
- Procedure name
- Line number
- Error type
- Expression (that caused the error)
- Operands (within the expression)
-
- An expression error (other than divide by zero) is
- considered un-recoverable by DMSERROR. A message is displayed
- and the user is given the choice of printing the error
- message and the application's screen where the error occurred,
- and / or quitting to DOS.
-
- When a divide by zero error occurs, whether using the /
- or % operator, DMSERROR will return 0 or the dividend of the
- modulus operation (respectively) back to the procedure. This
- code is found at lines 73 - 80 in DMSERROR.PRG. No error
- message is displayed in this instance.
-
- Miscellaneous Error
-
- Defined as unclassified and occur when the other error
- functions cannot deal with the error. Clipper passes the
- following parameters to DMSERROR:
-
- Procedure name
- Line number
- Error type
- Expression (that caused the error)
-
- A miscellaneous error is considered un-recoverable by
- DMSERROR. A message is displayed and the user is given the
- choice of printing the error message and the application's
- screen where the error occurred, and / or quitting to DOS.
-
- Print Error
-
- Defined as occurring when any print operation is or
- becomes not ready. It should be noted that this error traps
- only output through a parallel printer. Redirection to a
- serial port or a network spooler is handled by the Open Error
- function. Clipper passes the following parameters to
- DMSERROR:
-
- Procedure name
- Line number
-
- A print error stands a chance of being corrected. A
- message is displayed to this affect and the user is given
- some common problems to look for. If the problem is
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSERROR v.1.0 Copyright 1988 Data Management Systems - 3 -
-
-
-
-
-
-
-
-
- corrected, the print operation is continued, otherwise it
- will be aborted. It is important to note that the BREAK
- command is used to abort the print operation (see line 507 in
- DMSERROR.PRG). Using this would assume that you have
- surrounded the print operation with BEGIN SEQUENCE...END
- SEQUENCE. If this is not the case line 507 could be deleted,
- in which case a RETURN(.F.) is executed. This will tell the
- procedure to skip the line that caused the print error. See
- the Clipper manual for more information on this method.
-
- Open Error
-
- Defined as occurring when a file operation fails, or
- output to a serial device develops a problem. Clipper passes
- the following parameters to DMSERROR:
-
- Procedure name
- Line number
- Error type
- Expression (that caused the error)
- Operand (within the expression)
-
- The error message displayed here is multi-purpose. It
- informs the user that an open error has occurred and lists
- some possible corrective measures to take. It will also
- display the error type and expression to aid in diagnosing
- the problem. If it can be corrected, the operation can be
- retried, otherwise the error message can be printed and / or
- the program quit.
-
- If the error was caused by a failed file operation
- (other than under a network and the error is caused by a
- USE), it is considered un-recoverable and the appropriate
- action taken.
-
- If the error was caused under a network by the USE
- command, a RETURN(.F.) is executed. This will tell the
- procedure to skip the command and continue with the next line
- of code. This code is found at lines 273 - 276 in
- DMSERROR.PRG. No error message is displayed in this instance.
-
- If the error was caused by a problem with serial
- redirection of a print operation and the problem can be
- corrected, the operation can be attempted again. Otherwise
- the program should be quit.
-
-
-
-
-
-
-
-
-
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSERROR v.1.0 Copyright 1988 Data Management Systems - 4 -
-
-
-
-
-
-
-
-
- Undefined Error
-
- Defined as occurring when a variable (memory or field) is
- referred to before being defined. Clipper passes the
- following parameters to DMSOOPS:
-
- Procedure name
- Line number
- Error type
- Expression (that caused the error)
- Operand (within the expression)
-
- An undefined error is considered un-recoverable by
- DMSERROR. A message is displayed and the user is given the
- choice of printing the error message and the application's
- screen where the error occurred, and / or quitting to DOS.
-
-
- DMSERROR SUPPORT FUNCTIONS AND PROCEDURES
-
- To create as professional a runtime error system as
- possible, DMSERROR is supported by a number of external
- functions and procedures:
-
- DMSOOPS
-
- Also written by Data Management Systems, this is the
- vehicle for the error message displays. Version 1.10 update
- 09/15/88 is included with DMSERROR.ARC in its entirety. See
- DMSOOPS.DOC for more information.
-
- EXXTEND
-
- Written by J. Scott Emerich, these functions return the
- status of many of Clipper's SET commands. Both DMSERROR and
- DMSOOPS require these functions. See EXXTEND.DOC for more
- information.
-
- PRT_SCRN
-
- Written by Ray Love, this is a CALLable print screen
- routine that is compatible with all versions of Clipper.
- DMSERROR uses this to print the error message screens. See
- PRT_SCRN.DOC for more information.
-
- ETOC()
-
- Beginning at line 520 in DMSERROR.PRG, this function
- takes any expression (memvar, field, etc) and returns it's
- type as a character string. This is used by DMSERROR to
- display the error operands, but is written for generic use
- with any program.
-
-
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSERROR v.1.0 Copyright 1988 Data Management Systems - 5 -
-
-
-
-
-
-
-
-
- COMPILING AND LINKING
-
- DMSERROR can be compiled into a stand-alone .OBJ file
- for inclusion at link time. You could also place it within
- your standard procedure .PRG file.
-
- To compile with Clipper for a stand-alone .OBJ:
-
- CLIPPER DMSERROR
-
- To link with PLINK86:
-
- PLINK86 FILE <your files>, EXXTEND, PRT_SCRN, ;
- DMSERROR LIB CLIPPER, EXTEND
-
- To link with TLINK:
-
- TLINK <your files> EXXTEND PRT_SCRN DMSERROR ;
- ,,,CLIPPER EXTEND
-
- When using PLINK86 as the linker, you will receive an
- error 11 warning for each of the DMSERROR functions. Error 11
- means that duplicate definitions exist. Since CLIPPER.LIB
- already contains the same error functions, this is
- unavoidable - but not critical. The functions in DMSERROR
- will become the default for the runtime error system. You
- could avoid the warning messages by renaming DMSERROR.OBJ to
- ERRORSYS.OBJ or ALTERROR.OBJ, but this is not recommended.
-
-
- FUTURE OF DMSERROR
-
- The only modification that we have considered for
- DMSERROR would be to include "Print to disk" as on option to
- recovering from a print error. This was left out as a
- possibility for the future.
-
-
- DATA MANAGEMENT SYSTEMS ??
-
- We are a custom software house located in Fallbrook,
- California. Founded in 1983, our primary vehicle of
- development 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
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSERROR v.1.0 Copyright 1988 Data Management Systems - 6 -
-
-
-
-
-
-
-
-
- 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.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ────────────────────────────────────────────────────────────────────────────────
- DMSERROR v.1.0 Copyright 1988 Data Management Systems - 7 -
-
-
-
- .0 Copyright 1988 Data Management Systems - 7 -
-
-
-