I need help.In some case i need to ignore some error in my program.Usually we must choose cancel,suspend,or ignore right.I don't want it shown if found an error.What i should i do ? It seems like ON ERROR RESUME NEXT in Visual Basic ...
To gracefully handle errors, make your own error trap like above, then depending on the error number, you can choose to RETRY (for instance, obtain a record lock), RESUME (skip the line of code causing th error), CANCEL and so on.
To totally ignore errors, which is an option that should be chosen wisely, you can issue the command:
You could store the error in a database for viewing at a later time
on error do errtrap with ERROR(), MESSAGE(), MESSAGE(1), PROGRAM(), LINENO()
procedure errtrap
PARAMETER P_Err, P_Msg, P_Msg1, P_Prg, P_Lno
*
* dump data and memory status to text files
*
list status to file data.err
list memory to file memo.err
*
lnWorkArea = select()
do case
case used("ERRFILE"=.t.
select ERRFILE
case file("ERRFILE.DBF"=.t.
select 0
use ERRFILE
otherwise
select 0
create table ERRFILE.DBF (DATE d, TIME c(8), DATA m, MEMO m, option n(1,0))
use ERRFILE
endcase
append blank
replace date with date()
replace time with time()
append memo data from data.err
append memo memo from memo.err
select (lnWorkArea)
return David W. Grewe
Dave@internationalbid.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.