Re: TIB: Storing text on the 86


[Prev][Next][Index][Thread]

Re: TIB: Storing text on the 86




Douglas S. Oliver wrote:
> 
>     Hi, I've been reading with interest the discussions about
> creating phone books, etc. for the TI calcs and have been trying
> to figure out how and where text strings would be saved on the
> 86.  I have been unable to save text to a list.  I have tried
> saving my name for example to a variable (that works) and then
> saving the variable to a list (enhh (buzzer sound), try again).
> I've tried to write a word directly into a list, no go.  If text
> doesn't go into a list, then where?
>     I don't need a whole program, per se, just a simple segment
> to play around with.  Then again, maybe that simple segment must
> be a short program.  I've tried to find answers in the manual but
> got nowhere.  Am I just making a simple mistake or simply making
> wrong assumptions about what can and cannot be done?  Is there a
> faq page that will explain my specific questions?  (Your
> answering "yes" to this last question ain't gonna work.  I need
> to know specifically where it is and what to search for.  Every
> time I look for faq pages, I get a lot of irrelevant info, mostly
> because I am defining my search wrong, I suspect.)  Thanks for
> your help--D
> 
> --
> 
> Douglas S. Oliver
> Department of Anthropology
> University of California
> Riverside, CA 92521
> e-mail: douglaso@citrus.ucr.edu
>     or: dsoliver@earthlink.net

Here's the run-down on what I'm doing. Okay. First of all, keep in 
mind that I'm using an 83, and there are some differences...but I 
think most stuff is the same. The first thing here, is you need to 
realize that list can ONLY be used to store numbers. At least as far 
as I know. I have had several tell me they tried to do "B"->L1(1) or 
C->L1(2) or something like that - that just aint gunna happen. I'm 
guessing that this is where your little buzzer sounded. hehehe. This, 
however, doesn't mean that lists are unusable, it just means that 
there aren't real user-friendly. One thing that I'm not sure about - 
maybe somebody could fill me in on - is the way the 85/86 uses 
strings. Here's the deal with the 83. First of all, the calc will NOT 
let you use different variable names. For example, you can't store a 
variable or anything to a variable named JODY, or anything like that. 
All variables need to be stored as letters (A-Z, @ [capitol letters 
only]), or a varible that is already in the calc (like Xmin, or Xmax, 
or one of the statistics variables, or something like that). I suppose 
you could also create a list full of numbers and use each element as a 
different variable too...but now I'm sliding off topic... Anyway, the 
point - the point is, on the 83 if you want to enter anything like 
letters, it has to be done using a string. Using strings on the 83 is 
easy from within a program, all you have to do is use the command 
:Input Str1. Normally from the home screen anything inside quotation 
marks is considered a string. So from the home screen you can go 
"JODY_SNIDER"->Str1 and it would then have JODY SNIDER stored as 
string 1 (Note that the " " aren't included in the string, they are 
just used to show the beginning and end of the string). However, when 
you use a program you don't need to include the " ". So when that 
program is run there will be ? prompt, and whatever you type in will 
be stored EXACTLY as is into string 1. But there I go sliding off 
topic again....
Here's a quick description of what I've done in the past, and what I'm 
doing now. In the past when I have had to store letters, I have used 
lists. Keep in mind that you don't necessarily have to store the 
LETTER, so long as you know it's SUPPOSED to be a letter. For example, 
the list {10,15,4,25} could just be a bunch of numbers, or it could be 
my name, JODY. Notice that the J is the tenth letter of the alphabet, 
O is 15, D is 4, and Y 25...Get the idea?? There's a couple of 
problems that can come up, but the general idea works well. The other 
method, the one I been using recently, actually uses strings in a more 
permanent way. Basically what I do is prompt the user for some 
information - say their name. This is done using the same command as 
above; :Input Str1. Any information that you will need is recorded, 
and then String 1 is then squished together with Str0. Str0 is the 
permanent string, while string 1 will constantly be written over every 
time a new entry is made. So, if my full name was entered as three 
seperate entries, JODY PAUL SNIDER, then Str0 would look like this;
JODYPAULSNIDER. Note that this string will take the EXACT form as the 
order that the information was added. So if I inputed my name 
backwards, it would look like; SNIDERPAULJODY. Basically, I don't 
change the makeup of string 0 AT ALL. It stays exactly as it was 
inputed. What does change is the information about each entry. Stuff 
that you will need to know is this; the starting position of each new 
entry in string 0. So, for JODYPAULSNIDER, the list that stores the 
starting position would look like this {1,5,9}. Now, if you wanted to 
display each item to a new line, say from within a program, You simple 
have to display a sub-string of the big Str0, and that substring will 
go from the number in the list, and it will be for a length of the 
next number minus the number you are on. For example, to display JODY, 
you would use the command sub(Str0,L1(1),L1(2)-L1(1. This will display 
a sub string of Str0, starting with the first spot, and going for a 
length of 5-1, or 4. I could keep going, but I don't know how much you 
wanted to know...If you want to know more about putting things in 
alphabetical groups or anything like that just let me know (I like to 
talk [er, write :) ]). To sum this up, using lists is big and clumsy 
and takes up A LOT OF MEMORY, while strings are a little more 
difficult to use, but take a lot LESS memory. I think I like strings 
better.
Well, if anyone is interested in the specifics of my programs or if 
anyone wants some specific algorithms for doing certain things, just 
let me know.

Jody Snider
jody1@alaska.net


References: