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

Home » Public Forums » archive » Re: Can't pass data with CALL_EXTERNAL to C 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
Re: Can't pass data with CALL_EXTERNAL to C function [message #60835 is a reply to message #60832] Fri, 20 June 2008 07:56 Go to previous messageGo to previous message
Trae is currently offline  Trae
Messages: 23
Registered: May 2007
Junior Member
Dan,

In your call to call_external I don't see that you set the VALUE
keyword. This is what tells call_external which parameters you are
passing via value and which via reference. This may be the cause of
your problems. Whenever I am forced to use call_external, I set this
keyword manually,

From the help manual:

VALUE
A byte array, with as many elements as there are optional parameters,
indicating the method of parameter passing. Arrays are always passed
by reference. If parameter Pi is a scalar, it is passed by reference
if VALUE[i] is 0; and by value if it is non-zero. There are some
restrictions on data types that should be considered when using this
keyword, as discussed below.

As Brian noted, using call_external can be a beast. We worked on a
project for a week, before I concluded that it was much faster (and
easier) to rewrite the offending C code in IDL. Many a frustration
beer was drunk that day. :)

Good Luck!
-Trae




On Jun 19, 3:32 pm, Dan <daniel.dex...@colorado.edu> wrote:
> Hi Brian,
>
> Thanks for the tutorial, but I couldn't figure out how to make it work
> for my C code. In particular, none of the pointers work, not just the
> ones for the multi-D arrays.
>
> Could you (or someone) please clarify how you got pass by reference to
> work.
>
> Thanks again,
> -Dan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Implementation of G Statistic in IDL
Next Topic: Multidimensional arrays and CALL_EXTERNAL

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

Current Time: Wed Oct 08 19:58:53 PDT 2025

Total time taken to generate the page: 0.00374 seconds