I was playing around with more stat sprites today, using some sprites from Mario. I ran the program and liked the sprites. I didn't like the side-effect. After some investigating I found that the program lost about 4k of RAM after running. I don't know how it does this, so I was hoping someone could explain. Here's the code:
BASIC Code wrote:
:Output(4,3,"PLEASE WAIT
:{6,5,4,3,2,1,7,5,3,1,0,7,6,4,2,0,7,5,3,1,0,7,6,4,2,0,7,5,3,1,0,7,6,4,2,0,6,5,4,3,2,1→L1
:{0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,7→L2
:{7,6,5,2,1,0,6,5,4,3,2,1,6,5,4,3,2,1,7,5,3,0,6,5,4,3,2,1,5,4,3,2,6,5,1,0,3,1,0,5,2,1,6,5,4,3,2,4,3→L5
:{0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,4,4,4,4,4,4,5,5,5,5,7,7,7,7,8,8,8,9,9,9,10,10,10,10,10,11,11→L6
:0→Xmin
:0→Ymin
:94→Xmax
:62→YMax
:GridOff
:AxesOff
:PlotsOff
:FnOff
:L1→L3
:L2→L4
:L5+40→L5
:L6+8→L6
:For(A,8,88,8
:augment(L3,L1+A→L3
:augment(L4,L2→L4
:End
:Plot1Scatter ,L3,L4,∙
:Plot2Scatter ,L5,L6,∙
:Pt-Off(‾1,0
:Pause
:PlotsOff
:DelVar L1DelVar L2DelVar L3DelVar L4DelVar ADelVar L5DelVar L6Output(1,1,"
Generated by SourceCoder, © 2005 Cemetech

If it loses around 4k of memory on your calcs, then at least I know it isn't just my calc. Most of the code I have used in many other programs, so I was suprised that this happened.
looks like there are still issues with sourcecoder and ()/{}

other than that, I would have though it to be something like forgetting to delete lists after running or something.

is it every time you run? or just the first?
Well whenever I run the program I am left with 18k of RAM. I only lose the 4k RAM the first time I run the program after a RAM reset. So everytime I reset the RAM, this program sets it back down to 18k.
makes me think you are forgetting to delete a variable somewhere. check all your RAM variables.
Well that's what I thought at first. I've been doing this a few times and every time I check everything is either archived or the variables have been deleted. I just checked it again and got the same result.
after running it hit 0 and then enter about 30 times

This will clear out the Ans variable, which might free up the missing ram
or just Clear Entries...
elfprince13 wrote:
or just Clear Entries...


heh, yeah, or that Very Happy
Yes thank you. Adding ClearEntries at the end of the program worked. I guess I missed that since it didn't show up in the memory menu.
although Im not sure if that clears Ans too....

and what is Ans after a RAM clear?

[edit]
that doesn't clear ans, just the entries menu.

a RAM clear sets ans to 0.
elfprince13 wrote:
although Im not sure if that clears Ans too....

and what is Ans after a RAM clear?


Clear Entries does NOT clear Ans, but Ans itself only represents the last variable, so thats not a big deal (unless the last var)

Ans after a ram clear is 0

so


Code:
0
Clear Entries


would clear out Ans and all entries

[EDIT] seems like you figured this out yourself Wink
Ans is 0. I added both ClearEntries and 0 at the end of the program just in case ClearEntries didn't get Ans. It's all good now.
Superb. Sounds like that 4k was going to Ans after all.
  
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