On 4/20/2004 10:16:08 PM, Ian Binnie wrote:
>Thanks for the suggestion, I have
>modified the macro to check full long
>lines. This was easier than I
>anticipated.
>
>The macro retains the original case
>insensitivity.
>
I think I may have rushed into publication with the above macro.
It does work, and would probably be OK for most real applications, but I realised that the line
If(Match("|L",ERRBREAK) == 0) //IB 21/04/2004 ensure at EOL
would cause a short line in the remove-list file which matched the start of a longer line would cause a potential match to be skipped.
It should be NOERR.
Mind you the original would cause this line to be incorrectly removed.
I need to think more about the loop. The following from the original is not an infinite loop, only because the line is removed.
Repeat(ALL) { //Search for all occurrences
Buf_Switch(#11) //Switch to the source file
Search("|<|@(15)|Y|L",BEGIN+ERRBREAK) //Search for matching line
RCB(0,CP,CP+Chars_Matched,DELETE) //Move line to T-Reg 0
Buf_Switch(#14) //Switch to "removed" lines buffer
Reg_Ins(0) //Add the "removed" line
}
A fix to the potential problem needs a change to the loop, which I had not appreciated.
|
|