AlexBB


This massive app of mine that has been written in Fox has been failing in one particular function for the past few weeks. It is a search through a number of database tables. Other parts work well.

I haven't made any changes in the source code for months. The exception came out of the blue. One possible excpalanation is that something happened to the input data.

I cannot possibly debug it. The error message points to a line in code that is easy to find and a variable is mentioned that is not there but in a totally different function located in the same .prg file.

I put prints at all critical points (where the line of code in question is and where the variable "extq" which is unique to the whole program it seems is) and could not get any meaningful output.

On top of that when I click on Cancel button the program does not terminate (after the exception is thrown) and it goes around in circles. You have to click the button a few time, nothing happens. This is nothing new and I had a post years ago to get explanation but was told that is "normal." Now it is new: if you position your cursor on the SCREEN the whole thing freezes and you have to use task manager to crash fox.

Again it reinforces my negative impression of the whole package. It is very uncomfortable to use, that's for sure.

Please, help to find out a way out of it. I need this function.

Many thanks.





Re: catastrophic failure of a long running app.

Naomi Nosonovsky


Did you try to reindex your database (Delete all the indexes and re-build from scratch)

The error you're describing sounds like some sort of data corruption to me. It would be hard to find out.

Also what error are you seeing C0005 or some VFP errors

Please give a bit more details about the exact error message and the name of the procedure it causes.

Is it from the specific form Does the form have ActiveX

Thanks.






Re: catastrophic failure of a long running app.

CraigBoyd

Without knowing what the error actually is (you don't provide an error# or error msg in your post) and without knowing the line of code that it is blowing up on it's hard for me to help you.

The first thing to do is to stop allow VFP to handle the error with its default messagebox and resume tactic. Try using a good error handler.

Place the following at the top of your program's main prg...

Code Snippet

ON ERROR DO ErrorHandler WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO(1)

The place the following in your apps global procedure file or at the bottom of your main prg...

Code Snippet

********************
PROCEDURE ErrorHandler
********************
PARAMETER tnError, tcMessage, tcMessage1, tcProgram, tnLineno
LOCAL lcErrorMessage
lcErrorMessage = "Error number: " + TRANSFORM(tnError) + CHR(13) ;
+ "Error message: " + tcMessage + CHR(13) ;
+ "Line of code: " + tcMessage1 + CHR(13);
+ "Program: " + tcProgram + CHR(13);
+ "Line number: " + TRANSFORM(tnLineno)
MESSAGEBOX(lcErrorMessage, 16, "A Problem Has Been Encountered")
ENDPROC

As for the inability of your app to shutdown properly I would need to have more information about your On Shutdown routine and the code that is in your Cancel button. As with the error, you aren't providing enough information.







Re: catastrophic failure of a long running app.

AlexBB

Many thanks,

Been busy.

This is the error. The error message is a small window, NO error code:

An error has occured

"Variable 'EXT' not found"

(12)(XTQ)

OPENDATABASETABLE 2132

D:\VFP_PROJECTS\FIRSTPROJECT.EXE

Record Details in error log files

Two buttons YES & NO.

I usually click "NO" since the examining log files which I have done in the past gives me little useful info.

After clicking "NO" another form (very small again) appears with this text:

Continue Executing Program

Choose:

Ok to Continue the program

CANCEL to Exit program completely,

Two buttons:

OK & Cancel

I typically click Cancel and after that have a very hard time because the program never terminates but keeps looping and if the same unfortunate variable gets on the way it may continue for dozens of iterations. It depends on the executable code.

So, I go to the Task Manager and kill the process.

It is disgusting.

Thanks.






Re: catastrophic failure of a long running app.

Naomi Nosonovsky

I believe the error message is quite descriptive. It is obviously coming from the Error Handler and it points to the OpenDataSetTable routine. Did you try to search it for EXT variable and see why it may be undefined





Re: catastrophic failure of a long running app.

AlexBB

CraigBoyd wrote:

Without knowing what the error actually is (you don't provide an error# or error msg in your post) and without knowing the line of code that it is blowing up on it's hard for me to help you.

The first thing to do is to stop allow VFP to handle the error with its default messagebox and resume tactic. Try using a good error handler.

Place the following at the top of your program's main prg...

Code Snippet

ON ERROR DO ErrorHandler WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO(1)

The place the following in your apps global procedure file or at the bottom of your main prg...

Code Snippet

********************
PROCEDURE ErrorHandler
********************
PARAMETER tnError, tcMessage, tcMessage1, tcProgram, tnLineno
LOCAL lcErrorMessage
lcErrorMessage = "Error number: " + TRANSFORM(tnError) + CHR(13) ;
+ "Error message: " + tcMessage + CHR(13) ;
+ "Line of code: " + tcMessage1 + CHR(13);
+ "Program: " + tcProgram + CHR(13);
+ "Line number: " + TRANSFORM(tnLineno)
MESSAGEBOX(lcErrorMessage, 16, "A Problem Has Been Encountered")
ENDPROC

As for the inability of your app to shutdown properly I would need to have more information about your On Shutdown routine and the code that is in your Cancel button. As with the error, you aren't providing enough information.

Craig, thanks. You've helped me in the past. I am terribly busy now but will try this code in a two or three days for sure. Will report back.






Re: catastrophic failure of a long running app.

AlexBB

Naomi Nosonovsky wrote:
I believe the error message is quite descriptive. It is obviously coming from the Error Handler and it points to the OpenDataSetTable routine. Did you try to search it for EXT variable and see why it may be undefined

Naimi, You are incredible!!! It took you only three minutes to answer my post. Do you check for new arrivals every twenty seconds Smile JK.

Yes, it does point to that routine, however as I mentioned that variable extq has nothing to do with that routine. It is in fact located in a different routine.

I tried to put prints at both places as I mentioned in my first post and no useful information came out. The exq varianle did not print out before the app crashed at all. I had a blank screen.

The prints in openDataBaseTables routine gave meaningful prints on standard opening of about 30 dataBase tables (in variouss databases) when the form was opened and nothing before the crash. The crash occurs when I start a search through tables.

Answering your previous question about the nature of the app: it is a form with about 12 tabPages. Each page is saaturated with numerous buttons, grids, editor windows, textBozes, richTextboxes, treeViews and other controls. Some parts of it work just fine and I use those conveniences every day. A part of it is my major database for storing any information I need.

The part that is failing is a search through a database tables containing many objects related to MS C++ code definitions and OS in general. I created it in the past but used rather seldom since other sources are available but sometimes I need to find a keyword or object name in a dll file and I do not know which dll has it.

That's it folks.

Thanks.






Re: catastrophic failure of a long running app.

Naomi Nosonovsky

Yes, I hit refresh button quite often here and in UT and do some other stuff as well Smile

Anyway, back to your problem.

Is it being executed from some particular button of the form E.g. is it the same sequence of the operations that lead to this error

If yes, then I like Craig's idea of disabling the application error handler and trying to use our own error handler instead.

Is it VFP8+ application Don't remember if you mentioned the version.

If you answer yes on both questions, then we would put

try

do main routine

catch to loException

Log_Error(loException)

endtry

in the button's routine.

If not, then it's harder. We still may want to disable the current error handler and use something different. Either simple one suggested by Craig or a more sophisticated one Remote Debugger by Anton Oleynic. AFAIK the latter gathers all possible information about the current environment. I gave a reference to it here in some other threads.





Re: catastrophic failure of a long running app.

Christof Wollenhaupt

Hi,

you would get this error at some seemingly random place when you use the variable in a SET FILTER statement or in the WHERE clause of a fully optimized query. Instead of using a variable us its values. That is change

SET FILTER TO field=EXT

to

lcFilter = [field ="] + EXT + ["]

SET FILTER TO &lcFilter






Re: catastrophic failure of a long running app.

AlexBB

Christof Wollenhaupt wrote:

Hi,

you would get this error at some seemingly random place when you use the variable in a SET FILTER statement or in the WHERE clause of a fully optimized query. Instead of using a variable us its values. That is change

SET FILTER TO field=EXT

to

lcFilter = [field ="] + EXT + ["]

SET FILTER TO &lcFilter

OK, I am back to the Fox. It's been such a busy time, urgent development issues and in the end I lost my Internet connection at the partition where I had all my development (WindowsXP). So, I decided to install a Vista instead. It seems to be a great OS but as far as Fox is concerned it just cannot stomach it. Everything is breaking down even thing that worked in XP for sure.

Now I have to look into the issues seriously since I need to get my databases back. I will start with Craig's suggestion. I still have your code, Craig, working somewhere in my app. A special prg file. It says on top: * Craig's code.

Anyhow, I do not have SET FILTER TO, I belive anywhere but I will doublecheck.

Also, it is not really related but still I want to ask. In this new Vista environment when I installed a Visual FoxPro Development Studio I noticed that the Command Window and command window only moves around like in a slow motion with traces when you drag it with a mouse cursor. It is so weird. I cannot find an option to cancel it.

Many thanks to everyone. Will be back.