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

Re: Multiple values from a function?




"J.D. Smith" <jdsmith@astro.cornell.edu> writes:
> 
> void=routine_names('a',STORE=-1,val)
> 
> Lions and tigers and bears, oh my!

Pay no attention to the man behind the curtain!  I still say this
doesn't work for most cases, at least under Unix.  The following is a
simple transcript to test thes, which shows how ROUTINE_NAMES crashes
when A is undefined, but works when A is defined.  In every case that
I tried (as noted below), the variable A needs to be defined at the
calling level *first* before ROUTINE_NAMES(STORE=) will work.

It could be that this works under v5.3, or on Windows.  I don't know
since we don't have those versions around here.

Craig

IDL> .run
pro testset, name
void = routine_names(name,store=-1,findgen(10))
end
% Compiled module: TESTSET.

IDL> testset, 'a'   ;; A is undefined here, and it doesn't work
% ROUTINE_NAMES: Variable is undefined: a.
% Execution halted at:  TESTSET             2 /dev/tty
%                       $MAIN$                 
IDL> retall
IDL> a = 1
IDL> testset, 'a'   ;; Now A is defined and it works.
IDL> help, a
A               FLOAT     = Array[10]

IDL> print, !version
{ x86 linux unix 5.2.1 Jun  4 1999}
{ alpha OSF unix 5.2 Oct 30 1998}
{ x86 linux unix 5.1 Apr 13 1998}
{ alpha OSF unix 5.0 Apr 28 1997}
{ alpha OSF unix 4.0.1}


-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------