Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Deep Toaster on May 31, 2010, 03:40:00 pm

Title: Group memory check
Post by: Deep Toaster on May 31, 2010, 03:40:00 pm
Not necessarily a BASIC programming routine; just a helpful tip.

Sometimes, when I'm working on an on-calculator project which I occasionally "save" by storing the variables to a group, I need to check whether I already saved the current version. For example, I might be working on project "A", but want to switch to project "B", but don't know whether the group containing project "A" is the newest version or the old version from a few days ago. Instead of deleting and regrouping the files, which might be a complete waste of flash memory if the group was the newest version anyway, I found that, assuming the update changed the amount of RAM a variable takes up, the amount of memory a group takes up is equal to the sum of all its constituent (I like this word :)) variables, plus the length of the name of the group, plus 9. For example, if project "A" is comprised (I like this word also :)) of a program of 2624 bytes, a list of 12 bytes, and a string of 208 bytes, and if group *A takes up 2734 bytes, I'd know that I didn't save the updated variables (since 2624+12+208+1+9≠2734).
Title: Re: Group memory check
Post by: DJ Omnimaga on May 31, 2010, 11:43:09 pm
I generally just look at the group file size. If it's larger, it's generally the newest version, altough it's not necessarly the case if you previously went on an optimization rage. Another thing you can do is store the current build number in a variable before grouping (for example, A) and group that variable. Just increment it by 1 when you update, group it with the new programs then when it comes time to ungroup, just compare both variables.

Unfortunately, though it's easy to forget x.x
Title: Re: Group memory check
Post by: jsj795 on June 01, 2010, 12:02:54 am
What I generally do is put ProjectNameX
X being the version number (like 1,2,3,4,5...)
So for TLM I would go like,
TLM1
TLM2 (delete TLM1)
TLM3 (delete TLM2)
and so on. For other projects I do the same thing
Title: Re: Group memory check
Post by: ztrumpet on June 01, 2010, 08:45:37 pm
What I generally do is put ProjectNameX
X being the version number (like 1,2,3,4,5...)
So for TLM I would go like,
TLM1
TLM2 (delete TLM1)
TLM3 (delete TLM2)
and so on. For other projects I do the same thing
I wish I'd thought of that sooner!  That's an excellent idea!  I'm going to start doing that now. :)
Title: Re: Group memory check
Post by: calcdude84se on June 01, 2010, 08:47:20 pm
I've always done that, and you don't have to delete older versions if they may be useful.
Title: Re: Group memory check
Post by: Deep Toaster on June 01, 2010, 09:40:39 pm
I've always done that, and you don't have to delete older versions if they may be useful.

Wow, and that should also fix the problem with corrupted groups -- if one group is corrupted, you only lose the data from the last update. That's a really good idea!
Title: Re: Group memory check
Post by: jsj795 on June 02, 2010, 10:11:00 am
Yeah, I generally try to keep 2 latest versions, in case the latest version is corrupted, so you have something to fall back to... I don't usually keep more than 2 because of archive memory (although I have TI84+SE, I have too many groups for all the awesome games (including Illusiat 13, Reuben's Quest, bunch of asm games, etc...) and having too much groups decrease the size of RAM :(
Title: Re: Group memory check
Post by: DJ Omnimaga on June 02, 2010, 12:58:36 pm
wait, you keep Illusiat and Reuben grouped??? Holy cow that must be a lot of groups x.x (since Illusiat 13 is like 130 KB and the rest 100 KB each x.x)
Title: Re: Group memory check
Post by: ztrumpet on June 02, 2010, 04:51:35 pm
wait, you keep Illusiat grouped??? Holy cow that must be a lot of groups x.x (since Illusiat 13 is like 130 KB and the rest 100 KB each x.x)
Personally, I keep prgms I13, I13S, I13T, my current save, and the Pic in a group and then I have all the other files archived. ;D
Title: Re: Group memory check
Post by: jsj795 on June 02, 2010, 06:50:47 pm
Yeah, lol TI84+SE does have a lot of archive memory... Although I admit I did delete Reuben's Quest atm, because I was running out of archive :P
Title: Re: Group memory check
Post by: DJ Omnimaga on June 07, 2010, 04:15:10 am
Those two, Metroid and Illusiat 13 can be real memory hogs x.x

The later, fortunately, has much less sub-programs, though.