× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 2012/1/6 12:08 PM, Cyndi Bradberry wrote:
I can't seem to get my monitor opcode to work. I defined the error
code for an invalid date in the 'D' specs as BadDate.

C Monitor
C Test (E) RtDate
C On-Error BadDate
C Eval SError = 'Invalid Date'
C GoTo ReDisplay
C EndMon


Cyndi, when you code the (E) extender on the Test, that causes the error to be handled by setting on %Error.

As a rule of thumb, whenever you code (E) you should immediately follow it by a check of %Error.

You can either code the (E) and check %error:
C Test (E) RtDate
C If %Error
C Eval SError = 'Invalid Date'
C GoTo ReDisplay
C Endif

Or you can remove the (E) and then it will get to the On-Error:
C Monitor
C Test RtDate
C On-Error BadDate
C Eval SError = 'Invalid Date'
C GoTo ReDisplay
C EndMon

(But there's nothing wrong with mixing (E) and Monitor. You could use (E) and %Error to immediately deal with expected errors in a section of code, and use On-Error to handle any unexpected errors.)

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.