Ana Ferreira
Ana Ferreira

Reputation: 79

Shortcut to comment selected code in SAS Guide

is there some shortcut to just comment the selected code in SAS Enterprise Guide?

There is Ctrl + / to comment the selected line. But would be really useful to comment just a selected part of the code.

Thanks.

Upvotes: 5

Views: 9313

Answers (3)

cc3125
cc3125

Reputation: 21

Tested and working in SAS EG 7.1.

Program > Editor Macros >MAcros > Record new

You can either follow the sequence in the right side of the snap or create that using the options provided by SAS in left side.

enter image description here

Upvotes: 1

Dominic Comtois
Dominic Comtois

Reputation: 10411

You can create a Keyboard Macro for this (Program > Editor Macros > Macro...), as shown below. Only limitation is that the selection must be made from left to right / top to bottom. A workaround would be to use instead Cut selection, inserting /*, Paste from clipboard and inserting */. Drawback this time is that you'd lose previous clipboard content.

Edit Keyboard Macro - Comment Selected

Then, just assign it a keyboard shortcut, like CTRL-SHIFT-C for instance.

[EDIT]

While we're at it, here's another one to uncomment the blocks enclosed by /* and */:

Edit Keyboard Macro - Uncomment block

For this one, I assigned the keyboard shortcut CTRL-SHIFT-D.

Upvotes: 7

Joe
Joe

Reputation: 63424

The only built-in option in Enterprise Guide's keyboard shortcuts is to do line comments. You might be able to write a custom macro using Keyboard Macros (in Program -> Editor Macros), but I'm not aware of how that could be done.

Upvotes: 0

Related Questions