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

Home » Public Forums » archive » ROUTINE_NAMES and other magic
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
ROUTINE_NAMES and other magic [message #19865] Mon, 17 April 2000 00:00
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
One thing that ROUTINE_NAMES() (**note) cannot do is *add* variables
to another level. If the variable exists, then you can muck as much
as you want with it, but if it doesn't exist, sorry.


Oh, another funny thing. Try this recursive procedure:

PRO DEEPSTOP, level
if level EQ 2 then stop
deepstop, level + 1
END

and then run it with

deepstop, 1

% Stop encountered: DEEPSTOP 2 /dev/tty
IDL> help
% At DEEPSTOP 2 /dev/tty
% DEEPSTOP 3 /dev/tty
% $MAIN$
LEVEL INT = 2
Compiled Procedures:
$MAIN$ DEEPSTOP
Compiled Functions:

Okay, this is fine. We've stopped two recursive levels down. But
then if we try to set a variable like this:

IDL> a = 1

a = 1
^
% Unable to add local variable to recursively active program unit: DEEPSTOP

Freaky! It's probably not meaningful in most situations; only when
you have recursive procedures which define dynamic variables via
EXECUTE(). Just thought it was cute.

Craig


**note - ROUTINE_NAMES() is the recently discussed magical function
which allows one to manipulate variables at other call levels


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: openr and /get_lun
Next Topic: Re: default_button

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

Current Time: Sat Oct 11 07:45:34 PDT 2025

Total time taken to generate the page: 0.24018 seconds