Using Procrastinated Actions from an InputScript

One of the Newton 2.x OS Q&As
Copyright © 1997 Newton, Inc. All Rights Reserved. Newton, Newton Technology, Newton Works, the Newton, Inc. logo, the Newton Technology logo, the Light Bulb logo and MessagePad are trademarks of Newton, Inc. and may be registered in the U.S.A. and other countries. Windows is a registered trademark of Microsoft Corp. All other trademarks and company names are the intellectual property of their respective owners.


For the most recent version of the Q&As on the World Wide Web, check the URL: http://www.newton-inc.com/dev/techinfo/qa/qa.htm
If you've copied this file locally,click here to go to the main Newton Q&A page.
This document was exported on 7/23/97.


NEW: Using Procrastinated Actions from an InputScript (7/2/97)

Q: Calling AddProcrastinatedCall or AddProcrastinatedSend repeatedly with the same symbol from my input specification's InputScript method sometimes causes an out of memory exception on pre-Newton 2.1 devices. What's going wrong?

A: If you post a procrastinated action from an InputScript, it may not be executed until a much later time. Due to a bug in the way procrastinated actions with the same symbol are queued, it's possible to queue so many events that you run out of NewtonScript heap memory. This bug is fixed in the Newton 2.1 OS.

Here are two possible workarounds:

1) Use AddDelayedCall or AddDelayedSend in place of a procrastinated action.

2) Buffer the incoming data (perhaps into a temporary soup). Once the download has completed, perform the necessary operations on this data. This method also provides transactional integrity in the event the communications connection is unexpectedly torn down while downloading.