home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib32a.dsk
/
AUGUST.1987
/
SEARCH.DEMO.bas
< prev
Wrap
BASIC Source File
|
2023-02-26
|
1KB
|
34 lines
10 REM ************************
20 REM * SEARCH.DEMO *
30 REM * BY KEN KASHMAREK *
40 REM * COPYRIGHT (C) 1987 *
50 REM * BY MICROSPARC, INC. *
60 REM * CONCORD, MA 01742 *
70 REM ************************
80 TEXT : HOME : NORMAL
90 PRINT "SEARCH DEMO": PRINT "BY KEN KASHMAREK": PRINT "COPYRIGHT 1987 BY MICROSPARC, INC."
100 VTAB 6: ONERR GOTO 340
110 IF PEEK(116) < >147 THEN PRINT CHR$(4)"-SEARCH"
120 POKE 216,0:DQ$ = CHR$(34):SQ$ = "'":CO$ = ":"
130 MARK = 48840:OPEN = 48848
140 S$ = "25"
150 FI$ = "SAMPLE"
160 D$ = CHR$(4)
170 CM$ = "SEARCH " +FI$ +SQ$ +S$ +SQ$
180 PRINT "ISSUING THE COMMAND: ";CM$: PRINT "WITHOUT OPENING THE FILE": PRINT
190 PRINT D$;CM$: REM FILE DOESN'T HAVE TO BE OPEN
200 PRINT D$"OPEN";FI$
210 REF = PEEK(OPEN)
220 ONERR GOTO 300
230 POKE OPEN,REF
240 PRINT D$;CM$: PRINT "ISSUING THE COMMAND: ";CM$: PRINT "WITH FILE OPEN": PRINT
250 B = PEEK(MARK) + PEEK(MARK +1) *256 + PEEK(MARK +2) *131072
260 PRINT "MATCH FOUND AT OFFSET "B
270 PRINT D$"READ";FI$
280 INPUT A$: PRINT "FOUND: "A$: PRINT
290 GOTO 230
300 POKE 216,0: PRINT D$"CLOSE";FI$
310 EC = PEEK(222):EL = PEEK(218) + PEEK(219) *256
320 IF EC < >5 THEN PRINT : PRINT "ERROR CODE=";EC;", LINE #=";EL: PRINT
330 END
340 PRINT "THIS PROGRAM REQUIRES THE 'SEARCH' FILE TO BE ON THE SAME DISK"