I was trying to make a Taylor Series program for the Ti-84 CSE and I did this by using a For loop around these 2 commands
"("+Str2+"-"+Str2+")/2H"->Str2
"("+Str3+"-"+Str3+")/2H"->Str3

I didn't think that in less than 10 loops the strings would be at over 6kb each and was surprised when they were, but that wasn't the problem. After I went through and deleted the String variables I still only had 15 KB of RAM leftover. I reset the calculator and had 21 again so I re-ran the program to test it again and the same thing happened.
Anyone have any idea whats going on and how to fix it?
Are you sure you're deleting both String variables? and what are you starting Str2 and Str3 as? By going with that above, it will increase exponentially with each loop. IF we could get the entire program, that might be helpful.
Yes, I deleted every variable that wasn't in the archives. And I knew it would increase exponentially, but I didn't expect them to get that large at all.

Here's the file
There may be a syntax error or 2. I made it with Source Coder, which I don't normally do.
You can post the source code by opening it up in SourceCoder, copying the text, and wrapping it up in [c ode] [/c ode] tags without the spaces. Just for future reference. I'll try to download it and see what I see.
Hodograph wrote:
I was trying to make a Taylor Series program for the Ti-84 CSE and I did this by using a For loop around these 2 commands
"("+Str2+"-"+Str2+")/2H"->Str2
"("+Str3+"-"+Str3+")/2H"->Str3

I didn't think that in less than 10 loops the strings would be at over 6kb each and was surprised when they were, but that wasn't the problem. After I went through and deleted the String variables I still only had 15 KB of RAM leftover. I reset the calculator and had 21 again so I re-ran the program to test it again and the same thing happened.
Anyone have any idea whats going on and how to fix it?

Each time you run the program, Str2 and Str3 double in size. 2^10 = 1024, so after ten iterations, the string has grown to over a thousand times its original size. Far over that, in fact, because you also add data to the string each time.

If the last line of the program that was executed was a string operation, the string operation could have ended up in Ans, using up the missing 6 K. Maybe running an expression like 2+2 will clear it.
Thanks, I didn't think of that part. I modified the code so that it only used one string, but the string sizes still use large amounts of RAM. Although, there is no longer any "missing" RAM.
  
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