I want to build a program which has a user alert
facility as soon as it find some error while executing. For example if
there is a program like this
a = "try"
b = 2
) This program will find an error at line c = a*b.
and throw a *ERROR ..... message in icfb.log. I want to have a pop up
window which alert the user as soon as it exit. I am using a
try1=errset(testing) now. According to try1 value , (t or nil) i can
find if the program executed or not. but it will suppress the error
message in ICFB.log
This does what you want:
procedure(myErrorHandler(info) hiDisplayAppDBox( ?name 'myErrorDialog ?dboxBanner "Error occurred" ?dboxText info ?dialogType hicErrorDialog ?buttonLayout 'Close ?dialogStyle 'modal ))
By the way, if you use errset, you can either pass t as the second argument to errset, and then it will still print the error message. Or you can get the message info by accessing errset.errset . For example:
errset(testing() t)*Error* times: can't handle ("try" * 2)
unless(errset(testing()) printf("GOT THIS: %L\n" errset.errset))
GOT THIS: ("times" 0 t nil ("*Error* times: can't handle (\"try\" * 2)"))
You can find out more on errset.errset in the documentation for errset().