Documentation for FINDLQ version 1.1 10/21/87 FINDLQ -- "FIND, Library, sQueezed" (hereinafter FQ) is a utility which will allow you to type a file, ASCII or squeezed. The file may be a member of a library, or a standard file. FQ can also allow you to do a string search on any of these kinds of files. This utility will NOT work on "crunched" files. FQ can be used with command line parameters or without. A short help screen comes up if you simply type its name. *** FEATURES *** INTERACTIVE MODE ================ Entering the program name and a filename on which to work puts the program in "interactive" mode. E.g.: A5>fq b9:notebook.lbr will look for a file named NOTEBOOK.LBR on disk B:, user area 9. If the filename does not have an extension ('.' and one to three letters) the extension .LBR will be assumed. Therefore, to get it to work on a file named NAMELIST you must include the period-- A5>fq b4:namelist. so FQ will know you don't mean 'NAMELIST.LBR'. If the file is a library, you will be shown a numbered list of the member files (up to 80) and prompted with Enter number of file to read--> You quit the program by not entering a number, just a carriage return. If you entered a valid file number, it will then ask String to find: If you enter only a carriage return, FQ will change from a "find" program to a "type" program. It will attempt to display the file 23 lines at a time, and pause with the prompt [more] : [^X pause on/off] : [0-9 scroll speed] : [^C quit] : [ skip] Hitting will continue paging in this fashion. Entering a ^X (ctrl-X) will turn off the pause feature for continuous scrolling. It can be made to go back to paged display by typing another ^X. If the page pause is off, the speed of the scroll can be controlled by entering a digit from 0 to 9. 0 is the fastest, and 9 stops the display entirely until another digit is entered. Think of it as the delay factor, with the range from 0 delay to infinite delay (9). Hitting ^C will exit the FQ entirely. Hitting the ESCAPE key will skip the current file if it is a member of a library and take you back to the numbered list of library contents. If the file is a standard file (not in a library) hitting will abort the program. If you entered a string to find, e.g. String to find: Off the wall FQ will look for "Off the wall" in each line of the current file. If the string is found in a line it will be displayed. In interactive mode, the search is literal, that is, FQ will not report instances of "off the wall" or "Off the Wall". Upper and lower case count! If you want case ignored, you have to use the command line mode. COMMAND LINE MODE ================= Command line mode means that a string to find is entered on the command line when FQ is invoked. Example: A14>fq a5:birthday cousin means "search on disk A:, user area 5, in file BIRTHDAY.LBR through all member files and display every line that includes 'COUSIN', ignoring case". All the member files will be searched, even the unreadable ones (like BIRTHDAY.COM). Search can be aborted or cut short any time by pressing ^C. You may also specify one member of the library to search through or view. The file name that you give FQ as its first parameter can include the member separated by a slash ( / ), like this: A14>fq a5:birthday/nearby.fqm cousin This command will look in the file on A5: called BIRTHDAY.LBR for a member file named NEARBY.FQM (perhaps it was originally named NEARBY.FAM) and search in that member file only for the string "cousin" ingnoring case. NOTE: there is an effective limit to the length of the command line, due to the way Turbo Pascal handles the command line. Anything over 31 characters might get chopped off. I found the command FQ B15:FINDLQ1/FINDLQ1.DQC SEARCH P does not output to the printer but FQ FINDLQ1/FINDLQ1.DQC SEARCH P would. OUTPUT OPTIONS ============== Normal output while typing the file, or displaying lines with the string-to-find, is to the console. You can use a command line parameter to change that to the printer (the CP/M LST: device) or to a file. A14>fq a5:birthday cousin p will do as above, but the found lines will be sent to the LST: device. A14>fq a5:birthday p will go to interactive mode with the lines of the file you select to search or view going to the LST: device. A14>fq a5:birthday f will first ask you for a file name for all the output of whatever you decide to do in interactive mode (view or find). With the first release of FQ I tried to include the output file name on the command line but that made some of the command lines too long for Turbo Pascal to handle. See the note above in COMMAND LINE MODE about command line length problems. If there is already a file by the name you give, you will be warned and the program will abort. You can select another disk, e.g. give it a file name of b:selected.day but a different user area is not allowed. *** SHORTCOMINGS *** Speed--FQ, written in Turbo Pascal, is SLOW compared to assembly-language programs like FINDU. But it works, and works on libraries, and I needed something like this, so here it is. Large libraries--in interactive mode, the numbered menu is limited to 80 simply because it is practical and it fits on one screen. Tabs--my kludge to display assembly language listings, and other things using tab characters, is not very neat. It is readable. If you wish to customize it, note that the use of Paramcount and paramstr require Turbo Pascal version 3.0 or greater, and the Bdos calls require CP/M. *** ACKNOWLEDGMENTS *** The unsqueeze and library routines were lifted verbatim from Robert H. Maxwell's TBBS.PAS, using routines he borrowed from others (see source). That may explain where some of the strange constants that never get used come from. I just kept grabbin' variables and constants and type declarations until I got that part of the code to work separate from the rest of TBBS. Honest, I don't really understand Huffman encoding all that well. I don't know why the unsqueeze code works. I just know it does. The same goes for the library access code, although by sweating through that and examining library files with DDT I learned a lot -- enough to make it work. The syntax for the find function is unabashedly and baldfacedly influenced by FIND54.COM written by Irv Hoff, one of the all-time CP/M giants of the public domain. The use of Bdos() to get/set user areas I learned from Tom Geldner's articles that appeared in late 1985 in Micro Cornucopia technical journal. In fact, I learned Turbo Pascal mostly from poring over listings in that fine journal. Please send bug reports, suggestions for improvement, and tacky postcards to Joe Fremer 1250 Valley Vista Dr. Lowell MI 49331 or via GEnie to J.FREMER. =End=