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

Home » Public Forums » archive » Re: Passing strings by Spawn
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Passing strings by Spawn [message #59825] Fri, 18 April 2008 10:31 Go to next message
Anthony[1] is currently offline  Anthony[1]
Messages: 20
Registered: December 2006
Junior Member
Hi Alex,

On Apr 18, 12:48 pm, alex...@gmail.com wrote:
> Hello Everyone!
>
> I need to open an exe file using IDL, and pass a few string arguments
> (like as if it was a .c file)
> Anyway, I gathered I can use the Spawn command, and it does work,
> except for one issue.
>
> The arguments I pass to the exe file, are variables which contain
> strings. However, when I pass it by the Spawn command, the exe file
> receives the variables names rather than the strings themselves, which
> is quite silly.
> Since I get those string names from another function, I can't manually
> type them to the Spawn command (althought that would work)
>
> Can anyone give me some advice, should I use another command, or maybe
> some way to make Spawn like my variables more?
>
> Cheers, Alex

Is it something like this, or have I misunderstood?

spawn, 'exe_name ' + string_arg_1 + ' ' + string_arg_2

Cheers,

Anthony
Re: Passing strings by Spawn [message #59827 is a reply to message #59825] Fri, 18 April 2008 09:57 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Apr 18, 5:48 am, alex...@gmail.com wrote:
> Hello Everyone!
>
> I need to open an exe file using IDL, and pass a few string arguments
> (like as if it was a .c file)
> Anyway, I gathered I can use the Spawn command, and it does work,
> except for one issue.
>
> The arguments I pass to the exe file, are variables which contain
> strings. However, when I pass it by the Spawn command, the exe file
> receives the variables names rather than the strings themselves, which
> is quite silly.
> Since I get those string names from another function, I can't manually
> type them to the Spawn command (althought that would work)
>
> Can anyone give me some advice, should I use another command, or maybe
> some way to make Spawn like my variables more?
>
> Cheers, Alex

Just make sure the variable names are not quoted:

spawn, 'myprog ' + var1 + ' ' + var2

Mike
--
www.michaelgalloy.com
Tech-X Corporation
Software Developer II
Re: Passing strings by Spawn [message #59832 is a reply to message #59827] Fri, 18 April 2008 05:18 Go to previous messageGo to next message
Andy Heaps is currently offline  Andy Heaps
Messages: 22
Registered: March 2006
Junior Member
Hello Alex,
have you tried using EXECUTE?

var1='var_to_pass'
com='execname'+', var1'
PRINT, com
res=EXECUTE(com)

Cheers
Andy
Re: Passing strings by Spawn [message #59964 is a reply to message #59825] Mon, 21 April 2008 08:04 Go to previous message
alexbaz is currently offline  alexbaz
Messages: 4
Registered: April 2008
Junior Member
Thanks a lot, quite a blond moment by me.

Cheers,Alex
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem with histogram calculation - please need help
Next Topic: Re: Convolving speed issue

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

Current Time: Wed Oct 08 18:52:48 PDT 2025

Total time taken to generate the page: 0.00535 seconds