=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 03-29-93 (11:12) Number: 48 From: JANUSZ SUCHOROLSKI Refer#: NONE To: ALL Recvd: NO Subj: ASCII TEXT SEARCH + Conf: (35) Quick Basi --------------------------------------------------------------------------- I'd like to implement a "text search" while inside ASCII file. Here's some code: CLS INPUT "Text search: ", ts$ ts$ = UCASE$(ts$) OPEN "my_file.txt" FOR INPUT AS #1 LineNum = 0 WHILE NOT EOF(1) LineNum = LineNum + 1 INPUT #1, Check$ IF INSTR(UCASE$(Check$), ts$) THEN LOCATE 12, 1 COLOR 0, 7 MID$(Check$, INSTR(UCASE$(Check$), ts$)) = UCASE$(ts$) PRINT Check$ LOCATE 22, 1 PRINT "Found in ", LineNum COLOR 7, 0 DO Ky$ = INKEY$ LOOP WHILE Ky$ = "" CLS END IF WEND PRINT "No more matches, try again..." ========================== the end ======================= It simply shows the whole line in reverse video, however I'd like to see just the occurence(s) of the string highlighted instead of the whole line. I guess somebody did it before and might post a missing bit(bytes). Thanx, Janusz (John) Suchorolski TOPNET BBS (403) 241-8911 --- PcBoard 14.5U * Origin: 24 Lines, ZyXEL's (403)299-9900 (1:134/10) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20