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

Home » Public Forums » archive » Re: noop?
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: noop? [message #53290] Fri, 06 April 2007 09:58 Go to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Apr 6, 11:55 am, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
> Quoth hradilv:
>
>> On Apr 6, 11:37 am, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
>>> Hi all,
>
>>> Does IDL have some kind of noop statement? I'm looking for something to
>>> anchor breakpoints at a point where several control statments have their
>>> ends...
>
>>> cheers
>>> chris
>
>> Philosophical thoughts aside...
>
>> How about:
>
>> ; NOOP
>
> Ahhh...humour...and it works! :) I just wanted something to anchor a
> breakpoint in my code...the snippet looks like:
>
> endelse
> endfor
> endfor
>
> and IDL didn't want to put a breakpoint on those. A "stop" command would
> serve equally well...but I tend to forget to take them out, and then set
> my code running, come back an hour later to check...and ooops :-)
>
> cheers
> chris

I see. Usually I insert a "print" statement, then I get really ugly
output when I forget to remove them.
Re: noop? [message #53291 is a reply to message #53290] Fri, 06 April 2007 09:55 Go to previous messageGo to next message
Christopher Thom is currently offline  Christopher Thom
Messages: 66
Registered: October 2006
Member
Quoth hradilv:

> On Apr 6, 11:37 am, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
>> Hi all,
>>
>> Does IDL have some kind of noop statement? I'm looking for something to
>> anchor breakpoints at a point where several control statments have their
>> ends...
>>
>> cheers
>> chris
>
> Philosophical thoughts aside...
>
> How about:
>
> ; NOOP

Ahhh...humour...and it works! :) I just wanted something to anchor a
breakpoint in my code...the snippet looks like:

endelse
endfor
endfor

and IDL didn't want to put a breakpoint on those. A "stop" command would
serve equally well...but I tend to forget to take them out, and then set
my code running, come back an hour later to check...and ooops :-)

cheers
chris
Re: noop? [message #53293 is a reply to message #53291] Fri, 06 April 2007 09:43 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Apr 6, 11:42 am, "hradilv" <hrad...@yahoo.com> wrote:
> On Apr 6, 11:37 am, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
>
>> Hi all,
>
>> Does IDL have some kind of noop statement? I'm looking for something to
>> anchor breakpoints at a point where several control statments have their
>> ends...
>
>> cheers
>> chris
>
> Philosophical thoughts aside...
>
> How about:
>
> ; NOOP
>
> or
> return
> or
> return, 0
> ?

Maybe you can provide a little more info (example?) of what you are
trying to do.
Re: noop? [message #53294 is a reply to message #53293] Fri, 06 April 2007 09:42 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Apr 6, 11:37 am, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
> Hi all,
>
> Does IDL have some kind of noop statement? I'm looking for something to
> anchor breakpoints at a point where several control statments have their
> ends...
>
> cheers
> chris

Philosophical thoughts aside...

How about:

; NOOP

or
return
or
return, 0
?

Maybe a little more context is needed - or an example?
Re: noop? [message #53295 is a reply to message #53294] Fri, 06 April 2007 09:42 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Apr 6, 11:37 am, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
> Hi all,
>
> Does IDL have some kind of noop statement? I'm looking for something to
> anchor breakpoints at a point where several control statments have their
> ends...
>
> cheers
> chris

Philosophical thoughts aside...

How about:

; NOOP

or
return
or
return, 0
?
Re: noop? [message #53431 is a reply to message #53291] Fri, 13 April 2007 06:28 Go to previous message
Ingo von Borstel is currently offline  Ingo von Borstel
Messages: 54
Registered: September 2006
Member
Hi,
>>>
>>> Does IDL have some kind of noop statement? I'm looking for something to
>>> anchor breakpoints at a point where several control statments have their
>>> ends...

I sometimes have the same problem. I wrote myself a tiny function
"is_debug" and add a debug keyword to the functions I'm testing. My code
then reads somewhat like this:

PRO procedure_to_be_tested, param1, param2, debug=debug

this_debugvalue = 8
if not keyword_set(debug) then debug=0

for i=0,10000 do begin
for j=0,10000 do begin
for k=0,10000 do begin
do something
endfor
endfor
if is_debug(this_debugvalue,debug) then stop
endfor

FUNCTION is_debug, debug, value

RETURN, (debug AND value) eq value

END

If you set this_debugvalue to the n-th power of 2, you have a check
whether the n-th bit is set within the debug variable. Then, if the n-th
bit of debug is set, your procedure will stop. It will run normally
without stop, if you don't call it with the debug keyword.

I'm pretty sure there's a more elegant solution, but it works for me;

Best regards,
Ingo

--
Ingo von Borstel <newsgroups@planetmaker.de>
Public Key: http://www.planetmaker.de/ingo.asc

If you need an urgent reply, replace newsgroups by vgap.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: problem with widget_draw and draw_button_events under windows
Next Topic: Rotating 3D image

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

Current Time: Wed Oct 08 18:39:04 PDT 2025

Total time taken to generate the page: 0.00498 seconds