Topic: Garbage Text (1 of 2), Read 25 times
Conf: Wildfile, Other macros
From: Tom Hilton
Date: Tuesday, June 10, 2008 09:46 AM

Hello

I am trying to create a macro to delete all the "garbage" in different bits of text. In the "Key-mac.lib" file there is a macro which does exactly what I want; Deletes all lines in the file containing "garbage". The cursor is left
following the last deleted line and is as follows.

[VISUAL EXIT]BOF()repeat(ALL) {Search("garbage",ERRBREAK)BOL()Del_Line()}

I have copied it in exactly but whenever I press the desired shortcut for it, the cursor would just go to the beginning of the text documents. Is there something I should have checked or unchecked?

EDIT
I got this fixed nevermind now.

 


Topic: Re: Garbage Text (2 of 2), Read 19 times
Conf: Wildfile, Other macros
From: Christian Ziemski
Date: Tuesday, June 10, 2008 12:03 PM

on 10.06.2008 13:13 vtech-macros Listmanager wrote:
> From: "Tom Hilton"
>
> [VISUAL EXIT]BOF()repeat(ALL) {Search("garbage",ERRBREAK)BOL()Del_Line()}
>
> I have copied it in exactly but whenever I press the desired shortcut for it,
> the cursor would just go to the beginning of the text documents.

Try removing the ",ERRBREAK" for a quick test.
I think the macro then will tell you that it couldn't find any "garbage".

Or enhance the macro for example like this:


[VISUAL EXIT]
BOF()
repeat(ALL) {
Search("garbage",NOERR)
if (Error_Match) {
Statline_Message("No more hits.")
break
}
BOL()
Del_Line()
}


Christian