Topic: can a command macro know a highlighted block (1 of 4), Read 16 times
Conf: Search and Replace
From: Steve Rawling
Date: Friday, July 31, 2009 04:51 AM

I want to do the following

1 manually highlight a stream of text
2 run a command macro to search the highlighted block for a specific string and then scale the integer following each found string by a prespecified amount.

I already have a macro which successfully does the following on a whole buffer but when I want to run it on only part of a file I have to cut and paste that part to a new buffer, run the macro and then paste it back into the original buffer.



I understand the command SB("ss",p,q) but I often decide on the limits of the block by visual means, so therefore manually highlighting followed by running a command macro seems the most comfortable way to do this IMO.


Is there someway the command language can get the start and finish of a highlighted block into the p and q of the Search_Block command

Perhaps a command such as the menu command load and execute a macro but with the ability to tick a box that would execute it on a highlighted block only is what I need.

Steve

 


Topic: Re: can a command macro know a highlighted block (2 of 4), Read 13 times
Conf: Search and Replace
From: Christian Ziemski
Date: Friday, July 31, 2009 05:06 AM

On 31.07.2009 10:51 vtech-search-replace Listmanager wrote:
> From: Steve Rawling I want to do the following
>
> 1 manually highlight a stream of text
> 2 run a command macro to search the highlighted block [..]
>
> I already have a macro which successfully does the following
> on a whole buffer [...]
>
> I understand the command SB("ss",p,q) [...]
>
> Is there someway the command language can get the start and
> finish of a highlighted block into the p and q
> of the Search_Block command

The Block_Begin() and Block_End() can be used for that.

Christian

 


Topic: Re: can a command macro know a highlighted block (3 of 4), Read 13 times
Conf: Search and Replace
From: Fritz Heberlein
Date: Friday, July 31, 2009 05:13 AM

vtech-search-replace Listmanager schrieb:
> I understand the command SB("ss",p,q) but I often decide on the limits of the block by visual means, so therefore manually highlighting followed by running a command macro seems the most comfortable way to do this IMO.
>
But you can always use the search_block command for searching an
"visually" defined block (SB("NN",BB,BE).

If you want more comfort, simply write a dialog box that prompts
for a search string, writes it to a text register and search for the
contet of the register in your manually set block. You could even set
up a proximity search that way.

Fritz

 


Topic: Re: can a command macro know a highlighted block (4 of 4), Read 15 times
Conf: Search and Replace
From: Steve Rawling
Date: Wednesday, August 05, 2009 05:30 AM

thanks guys

I didn't realize it would be as simple as SB("string",BB,BE)

Thanks

Steve