Thanx

new topic     » goto parent     » topic index » view thread      » older message » newer message

--=====================_872896517==_

To the listserv:

Thanks to Bryan Watts, Pete Eberlein, and Robert Pilkington for suggesting
that I use 'wait_key' instead of 'get_key'.

I don't know why I didn't think of that.  I combed the library with a
fine-tooth comb and couldn't find anything that I thought would do the
trick, when all the time it was right there in front of me.


--=====================_872896517==_

Michael Bolin apparently misunderstood my other question about
'restore'.  He suggested 'seek' in the library.  But 'seek' seems
to do exactly what I *don't* want.  If I want to find something
in a file, when I know it is there, where it is, I have
previously hung something there to mark its location -- then I
use 'seek' to find that something.  That's not what I want to do.

I want to find something that may be in the file, but I don't
know where it is or even for certain that it exists.  The only
way to find it is to start at the beginning looking at each item
and saying, "No, that's not it ... that's not it ... that's not
it," and finally, "THAT'S IT!" or "Sorry, it's not here."  (Yes,
I know about binary searches and other techniques, but for a file
of this size, about 200 items, a binary search program is more
trouble than a straight sequential search.)

Suppose, for example, that my file contains a list of all the
presidents of the United States, arranged in alphabetical order
by first name.  Somebody calls out, "Benjamin," and the computer
replies, "Harrison;" or the call is "Warren," and the reply is
"Harding."  For "Franklin," the reply would be "Pierce or
Roosevelt;" for a real workout, the request "James" would produce
"Buchanan, Carter, Garfield, Madison, Monroe, or Polk."

For every search of the file, the program has to start at the
beginning of the file.  Having returned "Harrison" for the
request "Benjamin," it should not start with "Calvin" for the
next search when the request is "Abraham"; it will reply, "No
such president with that name," unless it wraps around at the end
of the file -- another trick that I don't want to bother with at
this point.

Without the 'restore' command I was asking about, subsequent
searches would begin in the middle of the file.  The 'restore'
command would enable a new search to start over at the beginning.

Okay, Michael?

Wally Riley
wryly at mindspring.com

--=====================_872896517==_--

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu