Trying to debug my main procedure in PanX that I’ve been using in Pan6 for years.
I have a form Film DBX:ENTRY that has many text display objects that need to be recalculated with each new record. Using .currentrecord, I call another procedure .currentMainPage when ENTRY is the top window. .currentMainPage does the calculations and displays the variables. It does not have a rtn command to return to .CurrentRecord, it has a stop at the end of the procedure.
Lately, I’ve been getting caught in infinite loops in which sometimes the calculations are made, sometimes not. (BTW: is cmd-. still supposed to cancel a procedure? It is not for me).
I’ve altered the code to try to see what is happening. Here is the code:
gvThisWin=info(“windowname”)
message “Current” // shows .currentrecord called
noshow
CASE gvThisWin=“FILM DBX” ; stop on data sheet
nop
stop
CASE gvThisWin=“FILM DBX:ENTRY” ; process for main window
CALL ".currentMainPage"
stop
[other cases, not relevant to question]
ENDCASE
showpage
endnoshow
STOP
.currentMainPage code
noshow
[defining lots of variables]
message “MAIN” ; this is a test to show me it is in the right procedure
[lots of calculations involving different files and windows]
statusmessage info(“databasename”)
showpage
message “Done” //shows procedure has run
stop
Right now, .currentrecord is running (I get the “Current” message), .currentMainPage runs (I get the “Main” and “Done” messages, and the calculations are made and displayed) but it goes into an infinite loop, constantly calling the .currentrecord procedure for the same record. The only way to stop is Force Quit or manage to close the ENTRY window while it is calculating.
Did not have this problem in Pan6, though I’ve been making so many changes to the .currentMainPage procedure in PanX that I may have tripped something.
What makes it constantly trigger .currentrecord, and how do I stop it? Is there now a better way to do this?
FWIW: About halfway through the Training Videos.
Thanks
Martin