Contents of the SEARCH2.DOC file
By Joseph J. Tamburino
Copyright (c) 1990
Revision History ...................................... 3
Legal Information / the ShareWare concept ............. 4
Introduction .......................................... 4
Included Files ........................................ 5
Features .............................................. 5
An Extended Look ...................................... 6
Source Code ........................................... 8
Closing Statement / Job Proposition ................... 8
Registered Trademarks ................................. 8
Before 12/15/90: SEARCH1 created but never released.
12/16/90: SEARCH1 was changed to SEARCH2 to reflect
the addition of read-ahead routines to speed
up the I/O of floppy drives and cacheless hard drives
12/16/90: Two bugs were observed by Channel 1 staff. They were:
1) more than 5 or 6 files searched at one sitting
crashed the program due to unnecessary
re-allocating of memory buffers.
2) ANSI drivers such as VANSI.SYS interfered with
the program due to their improper use of
The program's name was changed from Quick Search to
Quick Search to protect a program by Tom Price
12/17/90: Input routines, program exiting (no CLS) fixed.
This program, Quick Search, is copyright (c) 1990 by Joseph J.
Tamburino, along with all other files included with the archive
This package is distributed under the ShareWare concept. As such,
you may freely distribute the entire unmodified package to others,
as often as you wish. You may not exchange this product to other
people for money or other merchandise; it must be distributed
If, after a 20-day period, you find this product of value and wish
to continue using it, the author requests payment of $25.00 (student
discounts are available -- get in touch with the author for more
information). Send all payments and inquiries to:
Joseph J. Tamburino
7 Christopher Rd.
Westford, MA 01886
Phone: (508) 692-7756
Your payment entitles you to free upgrades (postage extra), as well
as notices of other software, as it becomes available.
Using Quick Search
Quick Search is a powerful and easy-to-use, file search utility
designed specifically for locating information contained within BBS
As an example, let's say your favorite BBS, which I'll call Channel
1, sends out a five or six large files all beginning with the letter
"C", and having no other extension. The files contain references to
every single program (and whatever else) available at Channel 1 BBS.
You are interested in a program which uses the Adlib sound card,
plays Christmas music, and works with VGA.
Now without Quick Search, you would have to load up your favorite
editor (if it can handle large-enough files), and search for every
occurrence of ADLIB. This could take forever, depending on how any
Adlib files there are in this BBS. You couldn't have it search for,
say, "ADLIB PROGRAM WHICH PLAYS CHRISTMAS SONGS", because you have
no idea how exactly the program is listed (if at all). Not only
that, but there are five or six different files that you would need
to search independently.
But since you now own Quick Search (or will), all you have to do is
SEARCH2 C*. MAS ADLIB VGA
I used MAS instead of CHRISTMAS since it could also be listed under
XMAS. Anyhow, Quick Search will now search the specified files for
any AREA of text which contains those three words. (It works by
area, not by lines, since file descriptions may reside on multiple
lines. The actual number of lines varies from area to area). The
search is accomplished independent of case, which means you could
search2 c*. mas adlib vga
and obtained the same information. You could have also omitted the
command line altogether since any information that isn't on the
command line will be prompted for after the program is run.
Before I present a more in-depth description of SEARCH, here is a
list of the files currently included with SEARCH2.ZIP:
SEARCH2.ASM -- The assembler source file for SEARCH. This file
is not required to execute SEARCH; it's only
included for the benefit of assembler language
programmers. It can be compiled with either
TASM or MASM.
SEARCH2.COM -- The executable version; the program itself.
SEARCH2.DOC -- This text file.
Quick Search Features
Here are the notable features of Quick Search
- Not case-sensitive, or even "phrase" sensitive. This means that
the search terms need only to be "near" each other to be selected,
they do not need to be in the order in which they are entered.
- Fast, even with large files (written in assembler).
- Two modes, search mode and view mode. In view mode, the file
can be scrolled interactively. Key words are highlighted.
- SEARCH2 normally accepts input from the keyboard, although this
input may be overrided by using the command line.
- File size is unimportant; works with file sizes from 1 byte up to
4096 megabytes (4G, which is more than you'll ever need).
- Supports wildcards. Sorry, only one file template may be
specified at once in this version.
Quick Search: An Extended Look
Here are the details. To invoke SEARCH2, just type its name, and it
will prompt you for two things: a file template, and your search
terms. The file template is the standard DOS method for specifying
a file, either by using a single file name or by using wildcards.
The search terms represent a listing of keywords which will be
Alternatively, these things can be specified on the command line.
Here is the syntax:
SEARCH2 [file template] [keyword [keyword ... keyword]]
In other words, just place the things you ordinarily would have been
prompted for on the command line separated by spaces. (The "..."
symbol in the above syntax diagram just represents possible
continuation of as many keywords as needed).
Once the program gets the data, it immediately opens up the first
matching file and begins its search. If it doesn't find any
matching file, it simply reports "Search Complete" and ends.
It searches using the following algorithm: It builds a table of
occurrences of the FIRST search term. If there was more than one
term specified, it makes a SECOND (and final) pass through the areas
who are LISTED in the table, but not with any areas not listed. It
is this pass in which the search is narrowed to reflect only those
areas containing ALL of the search terms. In terms of speed, it
really isn't important whether two passes are made, or one since the
second pass will generally take much less time.
There are instances, though, in which this two-pass system can cause
problems. If the first keyword entered is a popular word (such as
VGA), the search will take MUCH longer than using a less popular
word such as SILPHEED. The reason is this: The first pass through
the file builds up a table of the first word's occurrences. If that
word is popular and the table is long, the second pass has an
unnecessarily difficult job since it has to weed out a larger list
So if you wanted to search for, say, a disk caching program using
EMS memory, the following sequences of keywords would probably
produce long delays:
DISK CACHE EMS
EMS DISK CACHE
but the search will be fairly rapid if this sequence is used:
CACHE EMS DISK
since CACHE is probably the least-popular word of the group.
So the moral here is this: The relative speed of SEARCH2 can be
greatly increased by choosing keywords such that the first word is
the least likely to appear frequently.
After SEARCH2 completes its search, it either comes up blank (in
which it either exits to DOS or processes the next file), or it
continues into its full-screen viewing environment. In this mode,
five keys are available:
Esc - Exits the file to search other files (if applicable and
PgDn - Advances to the next MATCHING occurrence (not next
PgUp - Advances to the previous MATCHING occurrence.
Down Arrow - Scrolls file one line down.
Up Arrow - Scrolls file one line up.
Please note the difference in usage of PgUp and PgDn from what
you're likely used to. Instead of flipping pages, they change to
the next or previous MATCH. This can get confusing, especially if
you're using the arrow keys to scroll through the file and suddenly
get the urge to PgDn to the next page. Instead, you'll be
"teleported" to the next match which may very well be BEFORE your
current location in the file. If I get enough negative response
from this choice, I will consider changing the function of PgUp and
PgDn to their normal usage and adding two new commands to replace
PgUp and PgDn. Registered owners of SEARCH2 will get any upgrades
such as these for free (guaranteed, but you pay for the postage).
When you're done viewing the file, you might decide that you've seen
what you're looking for and wish to quit. In this case, press Esc
and press "N" at the prompt.
If you press "Y" to continue the search, the next file will be
loaded the program will go back into search mode, starting the cycle
Included with the package is the full source code to this product.
This is in keeping with my policy to always provide source code
freely along with my programs. I feel that by distributing source
code, it becomes possible for other people to make their own
improvements to the product to make it even better. This in turn
will increase the power of the tools available to the general
Those who make significant improvements to SEARCH2 are not required
to pay for the program, provided they make the program available to
the general public, as I have. In doing so, they may revise or
rewrite the documentation to their heart's content, as long as they
include an acknowledgment to my credit within the new documentation,
in addition to my address and CompuServe number. The same goes for
the source code. A "revision history" list, with my name appearing
as the first revision, would be appropriate in this case.
I sincerely hope that you enjoy SEARCH2, and wish to hear your
comments and criticisms about it. Feel free to get in touch with me
to discuss this and any other programs that you have of which I have
I am currently a senior in College and will be graduating within one
semester (the summer of 1991). If you like my work, and are seeking
a responsible, hard-working, mature person who "really knows his
stuff", please do not hesitate to give me a call. A resume will be
provided promptly. I specialize in IBM PC applications, and have
background working with Unix on both the Vax and on my own IBM PC.
Adlib and Silpheed are registered trademarks.
Channel 1 is full-featured BBS in Cambridge, MA with so many nodes
that I've lost count! Their number is: (617) 354-7077. 4096 MEGS
of space!!!! That's 4 GIGS!