• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Stack overflow problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stack overflow problem


  • Subject: Stack overflow problem
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 06 Apr 2016 16:46:08 +1000


G’day scripters

In my ‘constantly running 24/7’ app, I run a handler called ‘loopRunner' every two seconds, called from handler runningLoopInitializer()    

However, after processing about 50 consecutive email, I’’m getting the error

displayError Running Loop.  Error Stack overflow. error number -2706

I’ve found that because I cannot find a way to suspend the program at the end of runningLoopInitializer(), the calls mount up to far more frequently than every 2 seconds.

Is there some way I can avoid the ‘Stack Overflow’ error, perhaps by somehow terminating the programming loops after the line…
my performSelector:"runningLoop:" withObject:(missing value) afterDelay:mailManagerDelay
There’s nothing in Shane’s ‘Explored’ about this. I’ve added the lines 

 if errnum = -2706 then
my fordEvent()
end if


but don’t know if they’ll work.



Regards

Santa


on runningLoopInitializer()
try
set p to 1
my fordEvent()
#
-- This routine gets Universal Time
set p to 2
set my resetSelector to false
set p to 3
if my interarchyActivator and ((current date) - (my ftpWatcherCaller) > 60) then
set my ftpWatcherCaller to current date
tell application "Finder"
try
set theCurrentState to read file (pathToDesktop & "ftp Downloads:AllTheftpData.dat" as text) as text
if (count of theCurrentState) > 0 then
try
if not (exists process "ftp Watcher") then tell application ":Applications:Mail Manager:ftp Watcher.app" to activate
end try
end if
end try
end tell
end if
on error errmsg
tell application "System Events" to display dialog "runningLoopInitializer error " & errmsg & " p = " & p
end try
my performSelector:"runningLoop:" withObject:(missing value) afterDelay:mailManagerDelay
end runningLoopInitializer


on runningLoop:{}
my fordEvent()

etc, etc

           on error errmsg number errnum
if errnum = -2706 then
my fordEvent()
end if
if errnum is not in {-1712, -1728, -609} then
my displayError("Running Loop.  Error " & errmsg & " error number " & errnum as text)
end if
end try
end if # sub-apps are running
my runningLoopInitializer()
end runningLoop:



And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Stack overflow problem
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Can this be done, change hilite color?
  • Next by Date: Re: Stack overflow problem
  • Previous by thread: Re: Can this be done, change hilite color?
  • Next by thread: Re: Stack overflow problem
  • Index(es):
    • Date
    • Thread