Subject: EditFindFound in While loop?
I don't fully understand the use of EDITFINDFOUND, as the example
below shows.
When executed, this routine effects the Replace only once - a
chunk of text with, say, six Tab consecutive characters is
reduced to three Tab characters - it appears that two tabs are
replced by one tab three times.
Why doesn't the While/Wend loop pick up on the EditFindFound
condition? It exits after one pass, instead of returning to the
head of the loop.
Sub SqueezeSpacesToTabs
EditFind .Find = "^t^t", .Direction = 0, .MatchCase = 0,
.WholeWord = 0, .PatternMatch = 0,
.SoundsLike = 0, .ReplaceAll,
.Format = 0, .Wrap = 0
While EditFindFound()
EditFind .Find = "^t^t", .Replace = "^t",
.Direction = 0, .MatchCase = 0,
.WholeWord = 0, .PatternMatch = 0,
.SoundsLike = 0, .ReplaceAll, .Format = 0,
.Wrap = 0
Wend
End Sub
Thanks in advance for any hints, suggestions or tips.
Christopher.Greaves@WESTONIA.com
* 1st 2.00b #6263 * People and Computers
--- PCBoard (R) v15.3/25
---------------
* Origin: Westonia Computer Systems 1:250/636 (416)241-1981 (1:3615/51)
|