Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I force an error?

Status
Not open for further replies.

JohnLennon

Technical User
Jul 6, 2001
9
0
0
GB
Is there a way to force an ERROR()?

This may sound useless, however, what I'm doing is this.

GET(whatever)
IF ERROR() then
ERRORLOG.ERROR=ERROR()
OPEN(ERRORLOG)
ADD(ERRORLOG)
CLOSE(ERRORLOG)
END

But with clarion, when i open ERRORLOG, it'll clear the old error. When I return from this procedure, I want to have the original error message able to be checked for. Is this possible? Am I making no sense?

Jeremy
jnielson@ihccorp.com
 
Are You using ABC or Legacy?

For now, I guess it's better change the IF ERROR()
as follows:

GET(whatever)
IF ERRORCODE()
ERRORLOG.ERROR=ERROR()
OPEN(ERRORLOG)
ADD(ERRORLOG)
CLOSE(ERRORLOG)
END

And If You're using ABC:

GET(whatever)
IF ERRORCODE()
IF Access:ERRORLOG.Insert() = Level:Benign
ERRORLOG.ERROR=ERROR()
Access:ERRORLOG.Update()
END
END

Any error that could get the app. will be save to ERRORLOG File. That's what you pretending or I'm misunderstanding you????

Hope this help!. -----
carabez@hotmail.com
 
Sorry, I'd forgot something very important

IF ERRORCODE()
LOC:String = ERROR() !Save the error to a String.
IF Access:ERRORLOG.Insert() = Level:Benign
ERRORLOG.ERROR = LOC:String
Access:ERRORLOG.Update()
END
END

The initial ErrorCode are remplaced by the Insert Error code -if any-, so we need to save in a variable the original error!.

I guess it's the same for LEGACY

-----
carabez@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top