Plex 2E

 View Only
  • 1.  Looping Event Handler

    Posted Oct 31, 2011 01:02 PM
    I made a small change to an existing Edit function and the event handler started looping. I took the change out, and the event handler is still looping. The program changes the [mouse] cursor from wait to ready, back and forth constantly and the CPU goes to 98%.

    Anybody seen this problem?


  • 2.  RE: Looping Event Handler

    Posted Oct 31, 2011 01:19 PM
    Not seen this particular problem, but have seen similar situations where a previous change that went uncompiled remained in the model for the next poor slob to modify that program. In Plex it could be a change to an underlying base pattern that wasn't recompiled in all the downstream functions. You might need to run it through debug to find just where the looping is occurring. Sounds like it is unrelated to your change.


  • 3.  RE: Looping Event Handler

    Posted Nov 01, 2011 05:09 AM
    I had the same problem a while ago, and thought that something went wrong with the events handler as it kept on going in to a loop. But the debugger was my best friend.. I ended up debugging the function from the start, and right at the end there was this line of code hiding away that does a call back to the event which caused the function to loop, and loop.. This was also a result of a function that I took over from another developer and this line of code was "Accidentally" put there. I took it out and all worked again.

    Good luck


  • 4.  RE: Looping Event Handler

    Posted Nov 04, 2011 02:05 PM
    Thank you for the thought.

    Debug shows the Event LoadGrid being triggered over and over again. The program runs through subroutine Initialize, subroutine Reload Grid, then winds up back at Execute and the LoadGrid event triggers endlessly. I can not see what is triggering the event. The only Event mapping I have is GridP.LoadGrid is mapped to LoadGrid. I have looked through the generated C++ and no clues there either.

    Any thoughts will be greatly appreciated.


  • 5.  RE: Looping Event Handler

    Posted Nov 04, 2011 05:47 PM
    Missing Grid End On is what caused this.


  • 6.  RE: Looping Event Handler
    Best Answer

    Posted Nov 04, 2011 09:47 PM
    Missing Grid End On is what caused this.


  • 7.  RE: Looping Event Handler

    Posted Nov 04, 2011 02:05 PM
    Thank you for the thought.

    Debug shows the Event LoadGrid being triggered over and over again. The program runs through subroutine Initialize, subroutine Reload Grid, then winds up back at Execute and the LoadGrid event triggers endlessly. I can not see what is triggering the event. The only Event mapping I have is GridP.LoadGrid is mapped to LoadGrid. I have looked through the generated C++ and no clues there either.

    Any thoughts will be greatly appreciated.


  • 8.  RE: Looping Event Handler

    Posted Nov 04, 2011 02:29 PM
    Ah, now it's easy. I had this only a few days ago too!

    Is there a "Refresh Grid" statement in your load grid event which is used without checking if there are rows in the grid?

    That was the problem with the code I fixed. Normally there should be the call to Refresh Grid only if the GridCount > *Zero

    Hope this is the case for you too!

    Regards,
    Andy