The Incredible “Not” Search

Authors

Publication

Pub Details

Date

Pages

These changes allow ZX PRO/FILE to perform “NOT” searches. This is equivalent to printing all files EXCEPT the word you input as a search command. PRO/FILE’s builtin multi-word search mode is used in this routine. The computer searches all files for a match to the first word. If one is found, it then scans the file to see if it also holds the second word. The file is printed only if the second word is not found in the file.

To activate the “NOT” search, place a “/” in the last position of a multi-word search command.

  • 1983/MARCH/ will find all files that have the word “1983” in it EXCEPT those that also contain the word “MARCH”.
  • */OHIO/ results in all files EXCEPT those with “OHIO” in them.

Possible applications: club membership list (send newsletter to all members EXCEPT those who haven’t paid their dues); abstracts (all articles on a given subject EXCEPT those by a specific author); customer follow-up (send a subscription form to all customers of ZX Pro/File EXCEPT those who have already subscribed). Use the “NOT” search to find anomalies in your test results–list all cases in category 1 EXCEPT those with the predicted result. In fact, you can combine this search with File Tabulation and Ordered displays to reveal many fact about the statistics or test data stored in the program.

If you run a 64K version of PRO/FILE, these changes should fit without reducing capacity. On 16K programs, however, you. must reduce the DS array by 100 bytes. Add or otherwise change the following lines so they read:

35 IF X$="SAVE" OR LEN X$>28 THEN GOTO 18
36 IF Y$<>"R" THEN LET N=X$(LET X$)="/"
40 IF Y$<>"R" THEN LET X$=X$(TO LEN X$-N)
42 LET X$=X$
121 IF PEEK 16883 AND B<>1 THEN IF USR 16780=N THEN GOTO 115
125 PRINT X$+("-NOT " AND PEEK 16883 AND N);TAB 0;"FILE SEARCH",,,,TAB 1;"*";
1100 GOTO 42

One oddity of the “NOT” search is that. if you use the “*” as the first word of a search command, the first file to be displayed will say, “SEARCH IS COMPLETE” even if the search has only just begun. It’s a good practice to press ENTER a second time whenever this file is printed just to make sure that the search really is complete.

Products

Downloadable Media

 
Scroll to Top