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

Home » Public Forums » archive » Call_function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Call_function [message #7716] Fri, 27 December 1996 00:00
Phil Williams is currently offline  Phil Williams
Messages: 78
Registered: April 1996
Member
I have a routine that uses call_function to execute a function of the
users choice. Is there a way using the _EXTRA keyword that I can passed
named variables? I'm pretty sure of the answer, but figured I'd give it
a shot anyway.

Here's an example:

---------------------
function test, func, data, _extra = extra

extraFlag = keyword_set(extra)

if extraflag then result = call_function(func, data, _extra = extra) $
else result = call_function(func, data)
return, result
end

--------------------
IDL> foo = min(slice(index), max = max)
IDL> print,foo,max
73 192
IDL> bar = test('min', slice(index), max = max)
% MIN: Expression must be named variable in this context: <BYTE (
192)>.
% Execution halted at: TEST 5 test.pro
% $MAIN$
IDL> retall
IDL> bar = test('min', slice(index))
IDL> print,bar
73

Everything works fine as long as keywords aren't used for parameter
passing.

If anyone has a work around or an idea I'd appreciate it.

Thanks in advance,
Phil

--
/*********************************************************** ********/
Phil Williams, Ph.D.
Research Instructor
Children's Hospital Medical Center "One man gathers what
Imaging Research Center another man spills..."
3333 Burnet Ave. -The Grateful Dead
Cincinnati, OH 45229
email: williams@irc.chmcc.org
URL: http://scuttle.chmcc.org/~williams/
/*********************************************************** ********/
[Message index]
 
Read Message
Previous Topic: JHU/APL/S1R IDL Library update.
Next Topic: Good Quotes (lqlMpJ)

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

Current Time: Fri Oct 10 07:29:51 PDT 2025

Total time taken to generate the page: 0.95901 seconds