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

Home » Public Forums » archive » IDL Error GCPC data
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: IDL Error GCPC data [message #69320 is a reply to message #69259] Wed, 06 January 2010 10:42 Go to previous messageGo to previous message
sampton is currently offline  sampton
Messages: 8
Registered: December 2009
Junior Member
Hi,
I tried this code but got a santax error for .[j] when removing the
dot (.) I got an error about 'j':

fields = Tag_Names(struct)
OpenW, lun, 'C:\cgcp\data.txt', /Get_Lun
FOR j=0,N_Elements(fields)-1 DO $
PrintF, lun, fields[j], ': ', struct.[j]
Free_Lun, lun

Error:

IDL> PrintF, lun, fields[j], ': ', struc1979[j]
% Attempt to subscript STRUC1979 with J is out of range.
% Execution halted at: $MAIN$


with .j Error:
IDL> PrintF, lun, fields[j], ': ', STRUC1979.[j]

PrintF, lun, fields[j], ': ', STRUC1979.[j]
^
% Syntax error.




On 4 jan, 21:17, David Fanning <n...@dfanning.com> wrote:
> sampton writes:
>> Thanks again for your help,
>> I'm just wondering how I can save struct to data.txt after executing
>> the command under IDL:
>> IDL> read_v2_1, 'gpcp_v2.1_psg.1979', struct
>> I want to save struct to data.txt to be oppened with text editor under
>> windows (so data.txt wil be located under a spedcific folder say: c:
>> \cgcp\data.txt).
>
> I'd try something like this:
>
>    fields = Tag_Names(struct)
>    OpenW, lun, 'C:\cgcp\data.txt', /Get_Lun
>    FOR j=0,N_Elements(fields)-1 DO $
>        PrintF, lun, fields[j], ': ', struct.[j]
>    Free_Lun, lun
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: ITT VIS at the 90th AMS Annual Meeting
Next Topic: Mosaic_doit in IDL gives a different result that the ENVI mosaic tool

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

Current Time: Fri Oct 10 10:03:15 PDT 2025

Total time taken to generate the page: 2.00085 seconds