TIB: Re: Re:GetKey


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

TIB: Re: Re:GetKey




Memory error, that means that you are either:

1-Using a subprogram over and over and over again, without returning
each time.

2-Using a loop with a goto in it, such as:

Lbl A
...
if X=1
then
...
if Y=1
goto A
...
End

every time a loop is started or another prog is started, the info the
calc needs to return to the right spot in the original program is
stored in the "stack". When this stack grows it eats up memory, until
there is no more left. this explains problems 1 and 2. It really
bites, but this is why when you use goto statements, you should never
enclose them in a loop, you have to use goto statements also. What I
wrote before should be written like this:

Lbl A
...
Lbl B
if X[is not equal to]1
goto C
...
If Y = 1
goto A
...
Goto B
Lbl C

Or something like that, I think

I know this is a lot more complicated and slower, but you don't really
have a choice. Another problem: You run out of labels!!! well on the
82 anyway, I don't know about the 83.

You can probably try something with End statements at some locations
but I only got that to work once, with a lot of headaches... The idea
is that every time you start a loop, it has to be followed by an End
statement, but you can't have an End statement without a loop.

3-Or you are running the prog without enough memory for the variables,
I doubt this is the problem

About speed: I never got anything to move fast in Basic. Face it basic
is slow, are other progs like yours faster??

Philipp Keller

> The game takes about a second to move the character!  And with the
Ans
>variable, it appears to slowdown more each time you move before
finally
>greeting you with a MEMORY ERROR!  I remember reading some code that
used the
>Return statement and the Ans var to move the character, but it wasn't
>documented very well.   The writer said this made it faster.  I need
to know
>the fastest statement I can use for multiple keys.  All help is
appreciated:)
>
>Tatsuo
>