<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to customize tools, add button for commenting out selected text in enhanced editor in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521530#M141518</link>
    <description>&lt;P&gt;If you are using "Base" SAS or Foundation or Display Manager there is a default key combination&amp;nbsp;of Ctrl-/. Highlight the lines of text and the key combination will place /* */ quotes on each line.&amp;nbsp; Shift-Ctrl-/ will uncomment such commented lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't use EG or any of the SAS Studio so can't make suggestions for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Dec 2018 16:05:29 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-12-14T16:05:29Z</dc:date>
    <item>
      <title>how to customize tools, add button for commenting out selected text in enhanced editor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521362#M141457</link>
      <description>&lt;P&gt;How to customize tools and add a button for commenting out selected text in enhanced editor?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 03:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521362#M141457</guid>
      <dc:creator>hhtlib</dc:creator>
      <dc:date>2018-12-14T03:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to customize tools, add button for commenting out selected text in enhanced editor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521397#M141470</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/251214"&gt;@hhtlib&lt;/a&gt;&amp;nbsp;and&amp;nbsp;welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A couple of months ago I developed a keyboard&amp;nbsp;macro for this purpose in response to another user's post and assigned a keyboard shortcut to it. Since then I've been using it myself. See &lt;A href="https://communities.sas.com/t5/SAS-Programming/Referencing-marked-text/m-p/491164#M128748" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Referencing-marked-text/m-p/491164#M128748&lt;/A&gt;. I haven't tried yet to create a menu button for this, but in general I prefer keyboard shortcuts.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 08:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521397#M141470</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-12-14T08:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to customize tools, add button for commenting out selected text in enhanced editor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521530#M141518</link>
      <description>&lt;P&gt;If you are using "Base" SAS or Foundation or Display Manager there is a default key combination&amp;nbsp;of Ctrl-/. Highlight the lines of text and the key combination will place /* */ quotes on each line.&amp;nbsp; Shift-Ctrl-/ will uncomment such commented lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't use EG or any of the SAS Studio so can't make suggestions for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 16:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521530#M141518</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-12-14T16:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to customize tools, add button for commenting out selected text in enhanced editor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521707#M141571</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/251214"&gt;@hhtlib&lt;/a&gt;&amp;nbsp;and&amp;nbsp;welcome to the SAS Support Communities!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple of months ago I developed a keyboard&amp;nbsp;macro for this purpose in response to another user's post and assigned a keyboard shortcut to it. Since then I've been using it myself. See &lt;A href="https://communities.sas.com/t5/SAS-Programming/Referencing-marked-text/m-p/491164#M128748" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Referencing-marked-text/m-p/491164#M128748&lt;/A&gt;. I haven't tried yet to create a menu button for this, but in general I prefer keyboard shortcuts.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. It's a good alternate for ctrl+/ keyboard shortcut. I am lazy and most of time just use one hand to move/click the mouse. So a button for commenting the select text would be the best.&amp;nbsp;Wish we can assign same&amp;nbsp;commands to a customized button like what we can do for keyboard shortcut.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Dec 2018 06:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521707#M141571</guid>
      <dc:creator>hhtlib</dc:creator>
      <dc:date>2018-12-15T06:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to customize tools, add button for commenting out selected text in enhanced editor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521708#M141572</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;If you are using "Base" SAS or Foundation or Display Manager there is a default key combination&amp;nbsp;of Ctrl-/. Highlight the lines of text and the key combination will place /* */ quotes on each line.&amp;nbsp; Shift-Ctrl-/ will uncomment such commented lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't use EG or any of the SAS Studio so can't make suggestions for that.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. Wish the key stroke commands can be assigned to a button.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Dec 2018 06:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521708#M141572</guid>
      <dc:creator>hhtlib</dc:creator>
      <dc:date>2018-12-15T06:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to customize tools, add button for commenting out selected text in enhanced editor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521877#M141628</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/251214"&gt;@hhtlib&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanks. It's a good alternate for ctrl+/ keyboard shortcut. I am lazy and most of time just use one hand to move/click the mouse. So a button for commenting the select text would be the best.&amp;nbsp;Wish we can assign same&amp;nbsp;commands to a customized button like what we can do for keyboard shortcut.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I see three options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use a mouse with programmable additional buttons. Then you could emulate an arbitrary sequence of keystrokes by pressing a custom mouse button. That sequence of keystrokes could be either an Enhanced Editor keyboard shortcut or simply the&amp;nbsp;&lt;SPAN&gt;sequence of keystrokes&amp;nbsp;by which you would comment out marked text manually. I think this is the most convenient option because you don't even need to move your mouse and hit a small target area on the screen, but just click a mouse button.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Create an .exe file (say&amp;nbsp;cmt_out.exe) that&amp;nbsp;emulates the sequence of keystrokes&amp;nbsp;needed for commenting out (see above), e.g. with AutoIt, and make it available to the OS. Then create a button in the Enhanced Editor (Tools --&amp;gt; Customize... --&amp;gt; Customize --&amp;gt; Add tool) and associate it with the command&amp;nbsp;&lt;FONT face="courier new,courier"&gt;gsubmit "%sysexec cmt_out;"&lt;/FONT&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;If neither new hardware nor custom .exe files are allowed in your work environment, you can create a button in the Enhanced Editor (see item 2 above) and associate it with the command, say, &lt;FONT face="courier new,courier"&gt;gsubmit "%inc 'C:\Temp\cmt_out.sas';"&amp;nbsp;&lt;/FONT&gt;where cmt_out.sas is a program along the lines of this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nonotes nosource;
filename _cb clipbrd;
filename _tmp temp;

dm 'wcopy';

data _null_;
infile _cb;
file _tmp;
input;
put _infile_;
run;

data _null_;
infile _tmp;
file _cb;
input;
_infile_='/* '||_infile_||' */';
put _infile_;
run;

filename _cb clear;
filename _tmp clear;
options notes source;

dm 'wpaste';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;SPAN&gt;This program&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;copies marked text into the Windows clipboard, reads the text from the clipboard, writes it to a temporary file, reads it from there, encloses each line in C-style comments, writes this commented text back to the clipboard and pastes the content of the clipboard into the active window (which should be the Enhanced Editor). Test it and you will see that this is the least convenient option.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 17 Dec 2018 11:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/521877#M141628</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-12-17T11:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to customize tools, add button for commenting out selected text in enhanced editor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/522118#M141707</link>
      <description>&lt;P&gt;Great&amp;nbsp;solution. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Played with AutoIt, compiled an Exe file, and works well on my personal pc. But I don't have permission to do it for my company's notebook.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like the method of Option 3 is not stable. Some time it replaces the selected text directly to "/*&amp;nbsp; */", and sometime it pastes&amp;nbsp;clipboard content without &lt;SPAN&gt;&amp;nbsp;"/*&amp;nbsp; */". Maybe I did something not carefully and will do more tests.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For option 3, the entire code can be added to the button directly, not necessary&amp;nbsp;save to "C:\Temp\cmt_out.sas". &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The command for the button can be very long, like&amp;nbsp;the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;gsubmit "options nonotes nosource;filename _cb clipbrd;filename _tmp temp;dm 'wcopy';data _null_;infile _cb;file _tmp;input;put _infile_;run;data _null_;infile _tmp;file _cb;input;_infile_='/* '||_infile_||' */';put _infile_;run;filename _cb clear;filename _tmp clear;options notes source;dm 'wpaste';"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 06:42:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-customize-tools-add-button-for-commenting-out-selected/m-p/522118#M141707</guid>
      <dc:creator>hhtlib</dc:creator>
      <dc:date>2018-12-18T06:42:58Z</dc:date>
    </item>
  </channel>
</rss>

