当前位置:网站首页>How terrible is it not to use error handling in VFP?

How terrible is it not to use error handling in VFP?

2022-06-25 11:43:00 VFP of Garfield

 picture

2020

Error handling

Most people get it wrong . I don't know when , We started the forum to download the so-called error handler , Add it to the main function . This so-called handler , Is constantly popping up error prompt dialog boxes , Such error handling , No errors have been handled at all , The only thing to do is to keep popping windows . Better not .

1 Error handling , Is to solve the error

Program error , Catch errors , And stop executing the original program , Go to error handling , For example, the file is occupied , Let's try again if we can open , Can open the , We did it quietly , Or high-profile solution for users .

2 Error handling , If it cannot be solved, it must be reported

Program error , Catch errors , And stop executing the original program , Go to error handling , But the program cannot be restored , That is to exit the main program , And start the error sending interface , Put environmental information , Collect the error information , Write a blog or send an email to the developer .

Here are some error sending programs for foreigners , I made a fine adjustment

There are four documents in it , Put them in your software directory

errorhandler.prg

issues.scx

issues.sct

myfll.fll

3 Load the following code in your main function

*-- Running environment

If !Inlist(_vfp.StartMode,0)

Close All

*!* Error handling

On Error Do ErrorHandler With Error( ), ;

Message( ), ;

Message(1), ;

Program( ), ;

Lineno(1),;

" Qiyou food safety system "

Endif

That's how it works OK Well , We actively trigger an error in the main function , Let's see the effect

 picture

I received the message in my email

 picture

原网站

版权声明
本文为[VFP of Garfield]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200535523626.html