Is there anyway to do this, instead of being constricted to saving only to STR's..? (Or any other way would help.) Smile
Doing this is actually pretty straightforward. Just loop through each element in the string and convert each letter to a number as you go storing it to corresponding element in the list.
This is where I get lost :/
How would I convert the letters to numbers and interpret them..?
hellninjas wrote:
This is where I get lost :/
How would I convert the letters to numbers and interpret them..?

That'd be the job for a For loop - iterate through each character using sub(). To get a number from a character, use inString(source, search), where source is the character you're encoding and search is a string containing all the characters you want to accept (e.g. "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"). There's probably some more stuff you'd want to do with compression and the like, but that should be enough to pull you through.
I've never used Sub() or inString() in Basic.. So I honestly don't know what you mean Sad

Could you give an example..?
http://tibasicdev.wikidot.com/list-to-string
Note that lists use an entire real value per element, each of which is either 8 or 10 bytes (I can't remember which)
A string only uses one or two bytes per symbol, depending on the symbol. If you need to store a ton of strings, I can give you a more space efficient method.
I mention one such method in my book; you could, for example, store 5 or 6 two-digit non-negative integers per list element by packing them. For example "ABCKLMNOPDEF" -> {1,2,3,10,11,12,13,14,15,4,5,6} -> {010203101112, 131415040506}.
well i know this method (its easier then this one from tibasicwiki):

Code:
"abcdefghijklmnopqrstuvwxyz ."-->str1
input"text",str2
delvar L1
for(A,1,lengh(str2)
instring(str1,sub(str2,A,1)-->L1(a)
end

turn it back:

Code:
" " ->str3
" "-->str4
For(A,1,dim(L1)
L1(A)-->B
sub(str1,B,1)-->str3
str4+str3-->str4
end

hope i helped you Very Happy
KermMartian wrote:
I mention one such method in my book; you could, for example, store 5 or 6 two-digit non-negative integers per list element by packing them. For example "ABCKLMNOPDEF" -> {1,2,3,10,11,12,13,14,15,4,5,6} -> {010203101112, 131415040506}.

Do note that the TI-84 will remove the first "0" in 010203101112 since it views it as redundant, so what I would do is add a header to the beginning of the string (such as "99...") and when extracting the new string (99010203101112), you would skip the length of the header so that you are left with "010203101112", and likewise for any zeroes at the end of the string.
xX_Mr_Mann_Xx wrote:
KermMartian wrote:
I mention one such method in my book; you could, for example, store 5 or 6 two-digit non-negative integers per list element by packing them. For example "ABCKLMNOPDEF" -> {1,2,3,10,11,12,13,14,15,4,5,6} -> {010203101112, 131415040506}.

Do note that the TI-84 will remove the first "0" in 010203101112 since it views it as redundant, so what I would do is add a header to the beginning of the string (such as "99...") and when extracting the new string (99010203101112), you would skip the length of the header so that you are left with "010203101112", and likewise for any zeroes at the end of the string.

Dude this thread is 7 years old Razz
How did you find this thread to necropost on?
  
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 GMT - 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