TIP: Click on subject to list as thread! ANSI
echo: ms_word
to: ALL
from: CHRISTOPHER GREAVES
date: 1996-11-01 18:56:00
subject: EditFindFound in While lo

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)

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™.