MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: dissabling code segments

  • To: mathgroup at
  • Subject: [mg115181] Re: dissabling code segments
  • From: Murray Eisenberg <murray at>
  • Date: Tue, 4 Jan 2011 04:21:13 -0500 (EST)

In Mathematica 8, select the lines to be commented or uncommented, then 
either use Edit menu item "Un/Comment selection" or else the equivalent 
hotkey Alt + /  (Cmd + / on Mac).

Or select the lines, right-click and then select Un/Comment from the 
pop-up context menu.  (Ctrl + click to get context menu on Mac.)

You could discover the context-menu method by searching in the 
Documentation Center for "comment".  One of the entries is for the page 
"[Right-click] > Un/Comment" (ref/menuitem/UnComment).

In principle, you should be able to discover the menu method (and 
shortcut key) from the same search: on that same page 
ref/menuitem/UnComment there's a More About entry "Menu Items".  Click 
that. On the page guide/MenuItems you won't see any "Un/Comment" item. 
And if you click the Edit entry there, to get the page guide/EditMenu, 
you _ought_ to find "Un/Comment" -- but it's missing!  Clearly a 
documentation oversight.  (I just reported that to Wolfram tech support.)

On 1/3/2011 3:57 AM, Eric Michielssen wrote:
> Hi,
> Often, I would like to quickly disable (comment out) a few lines of my code.
> Of course, I can do this by enclosing these lines as (* lines *).
> I was wondering whether I could automate this operation and its reverse
> using the frontend, so that I just have to select the lines in question and
> press a hotkey combination.
> Thanks!
> Eric Michielssen

Murray Eisenberg                     murray at
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

  • Prev by Date: Re: How does Plot work?
  • Next by Date: Re: NDSolve, three 2-d order ODE, 6 initial conditions
  • Previous by thread: Re: dissabling code segments
  • Next by thread: Permanently install GenomeData