o.k., i have this exiting sequence that works, the only problem is that in order to actually exit, you have to hold down the "y" key. you can't just hit it and leave, it takes a while for the program to read it. i figured that it had something to do with my loop but i played and played with it to no avail. why does it take so long to read a key and what do i need to do to fix it? thanx for any help you could give.
` exiting sequence ++++++++++++
leave:
do
center text screen width()/2, screen height()/2,"Do you wish to exit (y/n)?"
`if a "y" is entered
if keystate(21) = 1
`delete sounds
for mp3 = 1 to 6
delete sound mp3
next mp3
`delete trees
for tr = 200 to 222
delete object tr
next tr
`delete orbs of life
for oof = 1 to 5
delete object oof
next oof
`delete water matrix
delete matrix 10000
`delete main matrix
delete matrix 1
`delete texture images
for i = 1 to 5
delete image i
next i
`delete arrays
UNDIM birdSound(5) :UNDIM MOffsetX(25)
UNDIM waterSound(2) :UNDIM MOffsetY(25)
UNDIM BigMatrix(600,600,1) :UNDIM MWire(20)
UNDIM StartLoc_X(1) :UNDIM MGhost(20)
UNDIM StartLoc_Z(1) :UNDIM Lock(20)
UNDIM Info(2) :UNDIM MatX#(20)
UNDIM TArrayX(1) :UNDIM MatY#(20)
UNDIM TArrayZ(1) :UNDIM MatZ#(20)
UNDIM FKey(10,1) :UNDIM MatWidth#(20)
UNDIM ColData(100) :UNDIM MatHeight#(20)
UNDIM ZoneData(100) :UNDIM TilesX(20)
UNDIM Tiles(500,500) :UNDIM TilesZ(20)
UNDIM OverTexture$(100) :UNDIM MatHi#(20)
UNDIM OverName$(20) :UNDIM MatLo#(20)
UNDIM ReplaceTex(100)
`now leave program
end
endif
`if a "n" was entered
if keystate(49) = 1
exit
endif
loop
RETURN
`end of exiting subroutine ++++++++++++++++++++++