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

Home » Public Forums » archive » TRICKY TASK USING AWK
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: TRICKY TASK USING AWK [message #92797 is a reply to message #92796] Tue, 01 March 2016 01:50 Go to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den tisdag 1 mars 2016 kl. 10:37:36 UTC+1 skrev Mats Löfdahl:
> Den tisdag 1 mars 2016 kl. 07:12:13 UTC+1 skrev Sapna Mishra:
>> Hi Heinz Stege ,
>> Error is as following:
>>
>> IDL> cmd ='awk -v var="$i" ''{print $var}'' ' + fname[i] + ' > ' + fnameo[i]
>> % Variable is undefined: I.
>> % Execution halted at: $MAIN$
>> IDL> print,'awk -v var="$i" ''{print $var}'' ' + fname[i] + ' > ' + fnameo[i]
>> % Variable is undefined: I.
>> % Execution halted at: $MAIN$
>> IDL>
>
> I think you need to do that inside the loop to get a useful error message. Or just set i to something between 0 and c.

Just guessing here, since we don't have the actual error message where IDL complains about the non-existence of fnameo[i]: is fnameo an array with c elements? In that case, your loop should go from 0 to c-1 rather than from 1 to c.

Or, since the complaint was only about fnameo and not fname, and you set fnameo[i] to 'tmp' inside the loop: is perhaps only fname an array while fnameo is undefined before you enter the loop? In that case, just substitute "fnameo" for "fnamao[i]" in the loop. Twice, of course.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Looping through structures
Next Topic: Segmentation fault (core dumped)

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

Current Time: Wed Oct 08 13:55:01 PDT 2025

Total time taken to generate the page: 0.00470 seconds