Author Topic: Visual Studio Macro equivalent in SE?  (Read 7849 times)

davejames

  • Community Member
  • Posts: 14
  • Hero Points: 0
Visual Studio Macro equivalent in SE?
« on: October 03, 2006, 05:57:10 PM »
Hi All,

I am a brand spankin new user to SE.

My main job at work is technical instruction so I provide customer training for new users on our equipment.  My particular products have been using Visual Studio for the C++ IDE.  I've recently been tasked to develop a class on a new product that uses SE for its IDE; hence the following situation/question...

I've been facilitating my classes by using the VS macro feature and a library of macro files, that when run, auto-insert blocks of C++ code alleviating a lot of tedious typing by the students.

My primary question is:  does SE have an equivalent macro feature as in VS?

If so, can you point me to a reference on how to use it?

Thanks very much,

davejames

mgweeks

  • Community Member
  • Posts: 24
  • Hero Points: 1
Re: Visual Studio Macro equivalent in SE?
« Reply #1 on: October 03, 2006, 06:26:22 PM »
Sure, there is a very extensive macro programming language. There is the Macro menu which lists several options. In your case, for inserting boiler-plate you can just select record macro, type the text, stop recording and save the macro by name. Then just have the students press <esc> followed by the name of the macro. Look in the help contents under "Slick-C Macro Programming Guide".

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Visual Studio Macro equivalent in SE?
« Reply #2 on: October 03, 2006, 06:53:23 PM »
Another promising way: Use the 'Code Template' feature.
Available since Slick v11.

HS2

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
Re: Visual Studio Macro equivalent in SE?
« Reply #3 on: October 03, 2006, 08:13:19 PM »
The aliases feature (tools->options->aliases) might also be useful; it can also take parameter arguments for the blocks of code you need to insert.

davejames

  • Community Member
  • Posts: 14
  • Hero Points: 0
Re: Visual Studio Macro equivalent in SE?
« Reply #4 on: October 03, 2006, 10:18:55 PM »
mgweeks, hs2, alex...

Thank you for the tips, I'll check them out.

Another question:  the "record macro" feature sounds interesting.  Is there a way that I can define my "boilerplate" offline and then insert it so I'm not attempting to actually record my keystrokes.

Thanks,

DJ

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Visual Studio Macro equivalent in SE?
« Reply #5 on: October 03, 2006, 10:44:10 PM »
'Recording a macro' means recording a sequence of commands and replay / save for later use ...
E.g. <start record>'Search <expression> -> Delete <hit> -> Insert blank line' etc.<stop record>
Single keystrokes which are not bound to a command are not recorded.

Here is an example how 'Slick-C Macro Programming' looks like (this example seems close to your needs):
http://www.slickedit.com/content/view/26/80/

BTW: The 'template' feature is also capable to do more than simply inserting text.

That's the good thing w/ Slick - there is always more than 1 way to go ;)

HS2

davejames

  • Community Member
  • Posts: 14
  • Hero Points: 0
Re: Visual Studio Macro equivalent in SE?
« Reply #6 on: November 20, 2006, 07:10:32 PM »
To All that responded,

I can call this thread closed as I've figured out how to insert lines of code into an edit session.  The "_insert_text" and "get_string" commands fill the bill quite nicely!

Regards,

DJ