Re: problems with call_function/procedure... [message #7599] |
Wed, 04 December 1996 00:00 |
Robert Moss
Messages: 74 Registered: February 1996
|
Member |
|
|
Hendrik Roepcke wrote:
>
> Hello,
>
> CALL_FUNCTION, CALL_PROCEDURE are nice functions, but
> due to the fact that the parameter-handling is strange,
> normally one has to use the overkill execute:
>
> b="/FLOAT"
> a=call_function('findgen',10,10,b,value=20)
>
> all this will show the problems with it...
>
> can anyone make it working WITHOUT execute?
>
> Hendrik
>
> --
> Panther in the Jungle __..--''``\--....___ _..,_
> -BELIEVE AND DECEIVE- _.-' .-/"; ` ``<._ ``-+'~=.
> http://www.ang-physik _.-' _..--.'_ \ `(^) )
> .uni-kiel.de/~hendrik ((..-' (< _ ;_..__ ; `'
This example doesn't show anything except the improper use of the
FINDGEN routine. FINDGEN has no keyword parameters, so when you try to
call it here with the /FLOAT and VALUE keywords, it fails. This has
nothing to do with CALL_FUNCTION.
However, if the point you are trying to get at is that you cannot pass
it a string like "/FLOAT" as per above, there is another way to do it:
b = 1
a = CALL_FUNCTION( "fltarr", 10, 10, NOZERO = b )
This will work just fine. Simply make use of the fact that
/KEYWORD is equivalent to KEYWORD = 1. Note that you can occassionaly
get into trouble, depending on how the code was written, if you are
trying to do KEYWORD = 0. (specifically, this may or may not be
equivalent to omitting the keyword).
--
Robert M. Moss, Ph.D. - mossrm@texaco.com - FAX (713)954-6911
------------------------------------------------------------ -----
This does not necessarily reflect the opinions of Texaco Inc.
|
|
|