Author Topic: Stop function from appearing in recorded macro.  (Read 7359 times)

JakeMontgomery

  • Community Member
  • Posts: 79
  • Hero Points: 8
Stop function from appearing in recorded macro.
« on: October 17, 2006, 02:49:58 AM »
The basic question is this: I have a macro, named my_stop_macro, that I have written and bound to a key.  When recording a macro, I want my_stop_macro to execute when the key is pressed, but not to show up in the final recorded macro.

That is the "general" question, the actual circumstance is that my macro calls end_recording, which is why it should not show up in the final recorded macro.

To illustrate, I have the macro below bound to ctrl-shift-T.  The actual macro does other things, but is simplified for illustrative purposes.

Code: [Select]
_command void my_stop_macro()  name_info(','VSARG2_EDITORCTL)
{
      // ... Other code ommited .....
      end_recording(false, "");
}

I start recording a macro, do some stuff, then hit ctrl-shift-T.  The macro stops recording (as expected), but the macro has a call to my_stop_macro() as the last line, which I do not want.

Any help would be appreciated.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Stop function from appearing in recorded macro.
« Reply #1 on: October 17, 2006, 06:26:05 AM »
I think you should add a _macro_delete_line(); to your macro.

HS2

JakeMontgomery

  • Community Member
  • Posts: 79
  • Hero Points: 8
Re: Stop function from appearing in recorded macro.
« Reply #2 on: October 17, 2006, 04:52:49 PM »
I think you should add a _macro_delete_line(); to your macro.

HS2

Works, thanks!
(I was looking in the documentation for macro_xxx functions, and stupidly, did not check for _macro_xxx functions).


Lisa

  • Senior Community Member
  • Posts: 238
  • Hero Points: 24
  • User-friendly geek-speak translator extraordinaire
Re: Stop function from appearing in recorded macro.
« Reply #3 on: October 18, 2006, 01:59:02 PM »
FYI (for future thread readers), another way to find these items in the help is to look at the Table of Contents > Macro Functions by Category. _macros are in the category "Macro Programming Functions".