Link to home
Start Free TrialLog in
Avatar of APS NZ
APS NZFlag for New Zealand

asked on

Debugging problem

Hi

I have written an interactive skill testing ap to be used as part of our staff training.  The questions are held in a file of records, each record containing the hotspots and allowable keypresses and the filenames of the graphics to load and their sequences.

As the user takes the test, for each question the file is opened and the question is loaded into the same record variable, then the file is closed again.

The tests all work perfectly, but if the user clicks the *Abandon the Test* button (or the *Continue* button when the test is finished), the form is meant to close but instead nothing happens.  I have single-stepped through the code and it definitely runs via the SkillsForm.Close statement.

I have been through my code and reworked all places that had Exit or Break statements to remove them, and I have also removed all recursive routines.

The problem is intermittent but happens often enough to be very annoying - especially if the user has sat 3 or 4 tests.  I think there has got to be a memory issue here, but I cannot see it.  Another strange thing is that the rest of the program will function normally even though the form will not close.

Any ideas??

John
ASKER CERTIFIED SOLUTION
Avatar of BlackTigerX
BlackTigerX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of illusion_chaser
illusion_chaser

Hi.
What is Windows version?
What is your Delphi version?
Can you send over code with the problem for testing (to: illusion_chaser@hotmail.com)?

ic
Avatar of APS NZ

ASKER

Thanks for the replies BlackTigerX and Illusion Chaser

I have found the source of the problem, but I have no idea why it is happening.  So that the program will respond to double clicks I have a timer loop which waits for .75 seconds after the first keypress.  In the OnDoubleClick event of the clicked image the var DoubleClicked is set to True.  For some reason the program goes back to the start of the routine which has the timer code in it, thus starting the timer again and running the subsequent code after that in the same procedure.

I will happily give BlackTigerX the points because that put me on the right track.

Thanx again.

John