calcs slowing down


[Prev][Next][Index][Thread]

calcs slowing down



Prince of Space wrote:
>
> I have noticed in many basic programs I have made for
> the 86 and the 83 that after a while, they seem to slow down.
> If I exit the program and restart it it is fast again.
> Does anybody know why this is and how I can avoid it?
> thanks

I have run into the same problem.  I don't know what is actually
happening, but here's a way around it - written laymen.  I think that
because the programs are stored as RAM and you also use RAM when you
run the programs, you ever so slowly use up everything that is
available.  It's like the calc wasn't designed to run things
indefinately, rather, it was designed to run a math program or
something like that, spit out an answer, and stop.  Now, if you think
about it, there isn't any limit as to how many times you can run a
program, so the problem for the programmer is to find a way to stop
your programs in the middle and then restart them again without
anybody realizing what's happened. Notice when you press enter it
executes the command that was previously executed.  This means that if
you stop a program in the middle, and then press enter again, it will
automatically restart the program from the top.  However, if, just
before you stop the program, you set some variable to a screwy number,
say 487->O, and then include the commands :If O=487:Goto x at the top
of the program it will jump to Lbl x. If Lbl x is placed right after
the stop, the calc will jump down to the same place where it left off
and continue with the program. Now all you need is some instance where
the user has to input something.  Instead of using the Input or Prompt
commands, run a getKey loop. When a button is pressed you need to
convert the getkey number (row/column position of the button) to the
actually number (ie. On my 83 if you press the number 1, getkey will
return the number 92. You need to convert the 92 to a 1), display that
number and stop the program. The effect will be very similar to what
the user would see if you had just used an input. And, just like if
you had used an input, the user will then press enter.  Normally this
would just let the program continue on, but in your modified program
it will stop the program and then restart it again when enter is
pressed - thereby eliminating the problem of slowing down!
Hope this helped...

Jody Snider
jody1@alaska.net


Follow-Ups: