comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: commenting
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: commenting [message #23779] Wed, 21 February 2001 04:54 Go to next message
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
"Christopher W. O'Dell" wrote:

> This is probably wishful thinking, but is there any way to
> comment out a large section of code as in C,
> where you don't have to insert a ';' on every line of code,
> but you can use a beginning and ending comment delimiter?
> I have this idea that there might be secret delimiters that
> i have not yet heard about in IDL. And I'm very lazy and
> have often longed for this feature.

Yes, the secret delimiters are 'GOTO, EndOfComment' and 'EndOfComment:'.

Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
Re: commenting [message #23788 is a reply to message #23779] Tue, 20 February 2001 11:04 Go to previous messageGo to next message
Paul Woodford is currently offline  Paul Woodford
Messages: 43
Registered: June 2000
Member
In the Macintosh version of IDL, select the block of text you would like
to comment, then select "Comment Lines" from the Edit menu or type
Command-M. You can also Un-Comment Lines (Command-,), Shift Left
(Command-[), or Shift Right (Command-]).

--
Paul Woodford, Ph.D.
Essex Corporation

For faster email response, replace us dot net with essexcorp dot com
Re: commenting [message #23791 is a reply to message #23788] Tue, 20 February 2001 08:51 Go to previous messageGo to next message
Christopher W. O'Dell is currently offline  Christopher W. O'Dell
Messages: 20
Registered: February 2001
Junior Member
that is BEAUTIFUL. perfect. Now my repetitive motion injuries
may begin the long healing process!

Thanks,
Chris

David Fanning wrote:

> Christopher W. O'Dell (odell@cmb.physics.wisc.edu) writes:
>
>> This is probably wishful thinking, but is there any way to
>> comment out a large section of code as in C,
>> where you don't have to insert a ';' on every line of code,
>> but you can use a beginning and ending comment delimiter?
>> I have this idea that there might be secret delimiters that
>> i have not yet heard about in IDL. And I'm very lazy and
>> have often longed for this feature.
>
> It's wishful thinking.
>
> But you can always temporarily wrap code you want to ignore
> in an IF statement:
>
> ignore = 1
> IF ignore NE 1 THEN BEGIN
>
> ... code to ignore here...
>
> ENDIF ; of code I am ignoring
>
> It's not elegant, but if the code you want to ignore
> consists of a lot of lines, it cuts down on repetitive
> motion injuries. And you can easily go back and forth
> just by setting the ignore flag. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438 E-Mail: davidf@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
Re: commenting [message #23792 is a reply to message #23791] Tue, 20 February 2001 08:43 Go to previous messageGo to next message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
"Christopher W. O'Dell" wrote:
>
> This is probably wishful thinking, but is there any way to
> comment out a large section of code as in C,
> where you don't have to insert a ';' on every line of code,
> but you can use a beginning and ending comment delimiter?
> I have this idea that there might be secret delimiters that
> i have not yet heard about in IDL. And I'm very lazy and
> have often longed for this feature.
>
> Chris

Select region. Enter [C-c ;] to toggle commenting. Requires
emacs+IDLWAVE. The lazy man's delight.

jd
Re: commenting [message #23793 is a reply to message #23792] Tue, 20 February 2001 08:17 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Christopher W. O'Dell (odell@cmb.physics.wisc.edu) writes:

> This is probably wishful thinking, but is there any way to
> comment out a large section of code as in C,
> where you don't have to insert a ';' on every line of code,
> but you can use a beginning and ending comment delimiter?
> I have this idea that there might be secret delimiters that
> i have not yet heard about in IDL. And I'm very lazy and
> have often longed for this feature.

It's wishful thinking.

But you can always temporarily wrap code you want to ignore
in an IF statement:

ignore = 1
IF ignore NE 1 THEN BEGIN

... code to ignore here...

ENDIF ; of code I am ignoring

It's not elegant, but if the code you want to ignore
consists of a lot of lines, it cuts down on repetitive
motion injuries. And you can easily go back and forth
just by setting the ignore flag. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: commenting [message #23867 is a reply to message #23779] Thu, 22 February 2001 10:56 Go to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
Alex Schuster wrote:
>
> "Christopher W. O'Dell" wrote:
>
>> This is probably wishful thinking, but is there any way to
>> comment out a large section of code as in C,
>> where you don't have to insert a ';' on every line of code,
>> but you can use a beginning and ending comment delimiter?
>> I have this idea that there might be secret delimiters that
>> i have not yet heard about in IDL. And I'm very lazy and
>> have often longed for this feature.
>
> Yes, the secret delimiters are 'GOTO, EndOfComment' and 'EndOfComment:'.

Hmmm, with that way you can only comment out lines not containing syntax
errors.
In emacs you can use idl-wave mode, mark a region and then type C-c ;
but who uses this mode will already know...

:-) marc
Re: commenting [message #23869 is a reply to message #23791] Wed, 21 February 2001 09:59 Go to previous message
jeyadev is currently offline  jeyadev
Messages: 78
Registered: February 1995
Member
In article <3A92A095.EB03CCA4@cmb.physics.wisc.edu>,
Christopher W. O'Dell <odell@cmb.physics.wisc.edu> wrote:
> that is BEAUTIFUL. perfect. Now my repetitive motion injuries
> may begin the long healing process!
>
> Thanks,
> Chris
>
> David Fanning wrote:
>
>> Christopher W. O'Dell (odell@cmb.physics.wisc.edu) writes:
>>
>>> This is probably wishful thinking, but is there any way to
>>> comment out a large section of code as in C,
>>> where you don't have to insert a ';' on every line of code,
>>> but you can use a beginning and ending comment delimiter?
>>> I have this idea that there might be secret delimiters that
>>> i have not yet heard about in IDL. And I'm very lazy and
>>> have often longed for this feature.
>>
>> It's wishful thinking.
>>
>> But you can always temporarily wrap code you want to ignore
>> in an IF statement:
>>
>> ignore = 1
>> IF ignore NE 1 THEN BEGIN
>>
>> ... code to ignore here...
>>
>> ENDIF ; of code I am ignoring
>>
>> It's not elegant, but if the code you want to ignore
>> consists of a lot of lines, it cuts down on repetitive
>> motion injuries. And you can easily go back and forth
>> just by setting the ignore flag. :-)

Come on, David, it is bloody elegant! I stumbled across this
in the days of Fortran II, with a GO TO statement to boot. Now,
that was a lot less elegant!

And, if you use vi, here is something I do:


:l1,l2s/^./;&

where l1 and l2 are the line numbers delimiting the block of interest.
And, you undo it with

:l1,l2s/;//

Voila!

--

Surendar Jeyadev jeyadev@wrc.xerox.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Running IDL from cron
Next Topic: Generally accessing the rest of the elements in an array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:10:01 PDT 2025

Total time taken to generate the page: 0.00891 seconds