You will recieve a memory error in any of the following instances:

1) You create a loop and within that loop, you Goto out of it alot.

2) You create a loop with Lbl/Goto and are using the Goto command inside of an If:Then End statement.

3) You call a program, then that program calls the parent program (The one that called it)

The reason you recieve such errors is because:

1A & 2A) The calculator stores to RAM everytime it reaches an If:Then command structure. Basically, the calc sees If A=1:Then it does this: End+1->End. (Not actual, just an example) And this takes up RAM. If it is done very frequently, then the memory will dissappear very quickly. Quitting the program will reset that "variable" You will also notice that in your game/program that it lags after some use, this is the reason.

3A) The calc also keeps track of which program calls another program by nearly the same means, but also takes up a little more memory, because it needs to keep track of stuff more. If you are always just calling programs, and never using Return, you will eat up the memory VERY quickly.


Anything I missed?
What ever happened to that other topic we had?
I don't know. We had agreed earlier to make this though, so I went ahead and made it. Smile
Anyway, looks good to me. Yay for the 1337.
good stuff
Anyways, lets keep this on topic.

Anything you can think of that needs to be added/changed?
Did you mention about Repeats and Whiles there?
Quote:
1) You create a loop and within that loop, you Goto out of it alot.


Think that should be changed?

Also, once we get more of these compiled, we need to make an official page for the info... Smile
How about since Gotos are the source of the memory errors, we provide examples of Lbls/Gotos being replaced by While/Repeat loops? I remember birdman from BPC asking for such an example. He might not be the only one who would need such an example. We could pick up any old program from ticalc.org, optimize it, and show the code in the official page.
I might try to come up with some stuff later...
How about one-line If's, like:

Code:

:0->A
:"A is"->Str1
:If A
:Str1+" not"->Str1
:Disp Str+" 0."


Does that take up the same RAM as an If..Then..(Else)..End structure?
No. Because you omit the Then and End, you save 4 bytes (2 tokens + 2 newlines).
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement