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

Home » Public Forums » archive » Re: Need help with basic spawn command
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: Need help with basic spawn command [message #54060 is a reply to message #54059] Thu, 17 May 2007 08:12 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
ryanselk@gmail.com wrote:
> Im running IDL on XP.
>
>
>
> I have this basic C code:
>
>
> #include <stdlib.h>
>
> int main()
> {
>
> int n=5;
> n=n*2;
> return n;
> }
> //This file is basic.c
>
>
>
>> From IDL, I just want to call this program and return n.
>
>
>
> In IDL, I can write:
>
> SPAWN, 'basic' ; this of course runs the
> basic.c program.
>
>
> But this doesnt return anythingof course.. ive tried to add another
> variable after this line such as:
> SPAWN, 'basic', variable

'variable' is supposed to contain whatever output your program
produces - in C terms, it contains whatever was written to stdout.
Your program doesn't write anything to stdout, so variable won't
contain any information. If you want to retrieve the exit status, what
you want is:

SPAWN, 'basic', EXIT_STATUS=variable
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: write a root group to HDF5 file
Next Topic: 2D interpolation with sparse data

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

Current Time: Fri Oct 10 07:31:13 PDT 2025

Total time taken to generate the page: 0.55838 seconds