[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ROUTINE_NAMES and other magic





Craig Markwardt wrote:

> 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.

You can add variables to another level.
Try this!



PRO DEEPSTOP, level
   IF level EQ 1 THEN BEGIN
      level = ROUTINE_NAMES(/LEVEL)
      varName = 'A'
      void = ROUTINE_NAMES(varName, STORE=(level+1), 8)
   ENDIF
   IF level EQ 2 THEN begin
   print,a
   STOP
   end
   deepstop, level + 1
END



IDL> deepstop,1
IDL>       8
IDL> % Stop encountered:  DEEPSTOP           9