New topic: Alternate Commenter for Windows
<http://forums.realsoftware.com/viewtopic.php?t=47860> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message barrytraver Post subject: Alternate Commenter for WindowsPosted: Mon May 13, 2013 6:15 am Joined: Fri Sep 30, 2005 1:53 pm Posts: 896 Location: Philadelphia, PA On the "Edit" menu in the IDE there is a useful feature called "Comment." "To use it, all you have to do is highlight that part of your source code that you want commented out and click on "Comment." The IDE obligingly puts an apostrophe in front of each line of the the highlighted text. (To restore the text, all you have to do is highlight the commented-out text and click on "Uncomment" on that same menu.) Here is an alternative to the "Comment" option on the REALbasic menu. The difference is that this utility adds two forward slashes and some blank spaces ("// ") to the beginning of the lines rather than a small apostrophe (" ' "'), making the comment marks stand out more and easier to see. This version works only with Windows because it make use of two Windows API calls, GetForegroundWindow and SetForegroundWindow. They are used to restore the focus back to the REALbasic IDE. Here's how to use the program. Run it while in the REALbasic IDE. If you want to comment lines with forward slashes, follow these steps: 1. Select the appropriate text (using mouse and right hand). 2. Do a ctrl-X (using keyboard and left hand). 3. Click on "Comment Lines" on this program (using mouse and right hand). 4. Do a ctrl-V (using keyboard and left hand). If you want to remove the forward slashes at the beginning of lines, follow these steps: 1. Select the appropriate text (using mouse and right hand). 2. Do a ctrl-X (using keyboard and left hand). 3. Click on "Uncomment Lines" on this program (using mouse and right hand). 4. Do a ctrl-V (using keyboard and left hand). It's that simple, and there's a natural rhythm to it (right hand, left hand, right hand, left hand). (Another way to highlight, of course, is to use shift and arrow keys. If you make a mistake, e.g., in highlighting the wrong text, remember that REALbasic includes a built-in Undo.) Here's where to get the source code for the program: http://traver.org/realbasic/commenter/commenter.rb. The easiest way to download the program is to right-click on the preceding URL using Firefox and use "Save Link As." The program has only a small footprint, but it does take up some space and is "always on top" (to make it readily accessible), so it is more likely to be helpful to the vision-impaired and to those who frequently comment out large blocks of text. Enjoy! Barry Traver Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
