Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Hot_Dog on December 12, 2010, 03:49:31 pm

Title: Length of Strings
Post by: Hot_Dog on December 12, 2010, 03:49:31 pm
How big are strings on a Ti-83+ allowed to get?
Title: Re: Length of Strings
Post by: nemo on December 12, 2010, 03:51:30 pm
Free RAM
Title: Re: Length of Strings
Post by: jnesselr on December 12, 2010, 03:52:31 pm
Err. Ram strings? As big as you want them, I guess. Actually, the size is two bytes, IIRC, so probably only 2^16 in length, but I'm not sure.

Also, ninja'd. (Hey look, no edit)
Title: Re: Length of Strings
Post by: nemo on December 12, 2010, 03:54:20 pm
good ol' TIBD (http://tibasicdev.wikidot.com/variables#toc4).

edit, and yeah i guess the limit would be 2^16 bytes. but since there isn't that much RAM on the calculator it'd be pointless.
Title: Re: Length of Strings
Post by: jnesselr on December 12, 2010, 04:13:47 pm
good ol' TIBD (http://tibasicdev.wikidot.com/variables#toc4).

edit, and yeah i guess the limit would be 2^16 bytes. but since there isn't that much RAM on the calculator it'd be pointless.
I guess you could have it go across an entire sector of memory.  Considering the other stuff you would need, that's a little less than 2^16 bytes still. So yeah, free ram. ;-)
Title: Re: Length of Strings
Post by: lookitsan00b on December 12, 2010, 08:12:29 pm
good ol' TIBD (http://tibasicdev.wikidot.com/variables#toc4).

edit, and yeah i guess the limit would be 2^16 bytes. but since there isn't that much RAM on the calculator it'd be pointless.
I guess you could have it go across an entire sector of memory.  Considering the other stuff you would need, that's a little less than 2^16 bytes still. So yeah, free ram. ;-)
The most free ram possible with TI-OS is about 24k, but the max length depends upon how you are writing to them.
If you use a built in command (ie anything other than an assembly routine) the string also has to be stored to Ans, so 12k.  I have gotten a string to about 10k before... using a TI-Basic program.

Every token was 'GarbageCollect', so, of course, I had to RCL it :P

EDIT: I guess you could have a longer archived string (but only if written by assembly), but I'm not sure how useful a 2-page string would be... after all, loading it with a TI-OS routine would give a memory error.
Title: Re: Length of Strings
Post by: meishe91 on December 12, 2010, 09:56:12 pm
Ya, as everyone else has said. Pretty much as many tokens as you can fit into about half of your free ram. Unless you used an Assembly routine to store directly into an archived string. Then depending on how things worked you could either get full archive or half of archive, about. But to be exact on how many spots in the length you have it depends on if you're just using single byte tokens, two byte tokens, or both.
Title: Re: Length of Strings
Post by: DJ Omnimaga on December 13, 2010, 04:22:19 pm
It depends how you store the strings. Something like
Code: [Select]
StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars+ "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + AnotherStringOf200IshChars + "LOLOLOL" + StringOf200IshChars stored to Ans can cause a massive memory leak of over 8000 bytes and slow down the calc to about 40% of its original speed until you break the BASIC program execution or exit. I had this happen during Illusiat 13 and Dark Link Quest development. It appears to be a TI-OS glitch causing an overflow somewhere in memory or something.

When storing huge series of concatenated strings, you must do it in multiple parts instead of all at once, to prevent that glitch.
Title: Re: Length of Strings
Post by: Builderboy on December 13, 2010, 04:45:28 pm
I think that bug is a bit easier to forgive than some of their others tho :P they would have probably had a hard time finding that bug during normal beta testing XD Then again, i wonder if its because of just general bad coding practices :P
Title: Re: Length of Strings
Post by: DJ Omnimaga on December 14, 2010, 02:45:33 am
Yeah, not a lot of people concatene this much string data at once anyway. :P It kinda reminds me the bug causing the calc to screw up if you recall a 2 byte token from ans or a string and you have 1 byte of RAM left (although that one should be fixed since it could randomly happen to anyone not being careful with how much RAM they have left)