A file has a timer running to call a procedure that triggers any one of several tasks based on circumstances. Most of the time it runs perfectly hour after hour as long as the tasks are somewhat modest.
One task of compiling reports can take about 20 minutes. It runs and completes properly.
At the end of the called procedure, all tasks get run through the same ending process:
OpenFile gvMonitor
gvStatus = "Idle @ "+timepattern(now(),"hh:mm am/pm")+¶+arrayrange(gvStatus,1,30,¶)
ShowVariables gvStatus
fileappend dbpath()+"Logs",datepattern(today(),"mm.dd.yy ")+"Monitor.txt","TEXTttxt",cr()+"Idle @ "+timepattern(now(),"hh:mm am/pm")
Stop
After running a lengthy task, the variable display and the log file both confirm that it has reached this point just as it does for shorter tasks. The difference is that on the longer task a spinning beachball is on the screen and a ForceQuit is required. The Stop was inserted to replace Rtn as part of my troubleshooting to ensure it wasn’t somehow running on to something else.
My best guess is that the timer is somehow getting backed up due to the time for the procedure to run. I need it to run more often than every 30 minutes, which would be a required padding for the long processes. As it is, every test run requires about 25 minutes, so every tested tweak is costly time wise.
Update:
The particular task I’m working on has a loop array to generate reports for a list of recipients. The full array is just over 300. If I trim it to 100, the whole procedure runs as before and still ends with a beachball. If I trim it to 50, it works as intended and there/s no beachball.
I have no idea why the size of the array matters, especially since the procedure completes its task either way.
I’ve also tried StopTimer when the procedure starts, then recreate the timer when it’s done. Notes added to my log file show that it gets beyond the timer restart and all the way to the code posted above. That hasn’t ended the beachball result.
It appears that the workaround is to break the array into smaller pieces and run each separately.