TIP: Click on subject to list as thread! ANSI
echo: qedit
to: ALL
from: ED MARSH
date: 1998-05-12 05:07:00
subject: AlsoFind correction

From: Ed Marsh 
>Hello Ed
>
>A tiny private remark.
>
>When doing a Find and using the "c" and "g" options simultaneously,
>this means: start searching from the begin of the line.
>
>So the second search in AlsoFind should not be necessary.
>
>Carlo
Hello Carlo,
You were right and I was wrong. I shall go stand in the corner
for an appropriate length of time.
In my trial-and-error approach to the matter, I thought sure
I had tried it your way, but I must have been in error!  ;-)
FWIW to Skipper: After learning the above lesson, I also tried
searching for _three_ targets, and it works just fine.
Thanks to Carlo, we can both do our work more easily.
Ed
The corrected macro, complete with its helper proc:
/* ****************************************************************
   AlsoFind()  provides a way to search for two or more different
   targets on one line, and if found, copy that line to another
   file for processing.  NOTE: must have blank line at end of file
   to hit on last text line!
**************************************************************** */
string TARGET1[] = ""
string TARGET2[] = ""
string TARGET3[] = ""
proc mXfer()                           // helper
    Copy() if NOT NextFile() NewFile() endif
    EndFile() Paste() UnmarkBlock() EndFile()
    if CurrLineLen() == 0 Addline()
        else AddLine() AddLine()
    endif
    PrevFile() Down()
end
proc AlsoFind()
  repeat
    if lFind(TARGET1,"icg")
       and lFind(TARGET2,"icg")
       and lFind(TARGET3,"icg")
           MarkLine() mXfer()
    else Down()
    endif
  until CurrLine() >= NumLines()
end
AlsoFind()
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.