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

Home » Public Forums » archive » inconsistent results running an absurdly simple function using '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
inconsistent results running an absurdly simple function using 'spawn' [message #78705] Wed, 14 December 2011 10:12
desertdryad is currently offline  desertdryad
Messages: 39
Registered: August 2011
Member
I have a problem that is making me batty, on IDL 7.0.

I'm trying to use a simple function I wrote, that spawns a clal to a
Perl script. IT works as I expect, 'some of' the time in a
predictable fashion. Here is the script:


--------------------------
compile_opt idl2

spawn, 'C:\\Cyndys\WEATHER\mesomech3.pl '+station, result
print, result
data=result[4]

return, data
end
---------------------------

So, I wish the function to return the 4th line of output from the Perl
script (which reads stuff from a web page for me).

The first time in a session that I try to run this, it will NOT work;
I get this error at run time:

% Attempt to subscript RESULT with <LONG ( 4)> is out of
range

NOW, here's the bizarro part - if I take out 'return, data[4]' and
replace it with 'return, data' the function works. But THEN, if I put
that line of code back to 'return, data[4]' .. that then also works!
What the Hey.

I need to run this function without altering the code back and forth
each session. Any idea what's going on, here??

thanks!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Incomplete ouput PNG files.
Next Topic: Re: inconsistent results running an absurdly simple function using 'spawn'

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

Current Time: Thu Oct 09 07:55:09 PDT 2025

Total time taken to generate the page: 1.17345 seconds