[comp.sys.apple] RESET never 100% reliable

dlyons@Apple.COM (David Lyons) (10/08/89)

[David Brierley asks how to "deactivate" the reset key.  Philip Stephens
says you can't do it reliably, even though the Applesoft BASIC reference
manual shows a method for trapping reset.  Michael Pender disagrees and
refers to a Nibble article showing how to trap reset in an Applesoft
program.]

Under Applesoft, you can trap reset *most* of the time.  It will usually
work, but it can't *always* work.

Why?

Imagine this:  the Applesoft program is executing the statement X=5, and
this is the first time the variable X has been referred to during the
program--but there are lots of other variables, including some arrays,
already used.

The Applesoft interpreter has to -copy- all those arrays to a location
7 bytes higher in memory, to make room for X.  Now, right in the middle
of that copy, the user hits Reset.  Ouch!  The arrays are a big mess,
and Applesoft will probably crash next time you try to access one of
your arrays or create a new array.
-- 

 --Dave Lyons, Apple Computer, Inc.          |   DAL Systems
   AppleLink--Apple Edition: DAVE.LYONS      |   P.O. Box 875
   America Online: Dave Lyons                |   Cupertino, CA 95015-0875
   GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
   Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons

   My opinions are my own, not Apple's.