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

Home » Public Forums » archive » index arrays of structures
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: index arrays of structures [message #59298 is a reply to message #59229] Mon, 17 March 2008 09:29 Go to previous messageGo to previous message
raghuram is currently offline  raghuram
Messages: 32
Registered: February 2008
Member
On Mar 17, 8:03 am, David Fanning <n...@dfanning.com> wrote:
> Reimar Bauer writes:
>> Have to say first that is not a solution for your current problem. But
>> sometimes you like to know about this too
>
>> You can directly read into pointers
>> this examples assumes files of equal filesize (it reads now only one
>> file, but you can use [i] for [0] )
>
>> a={data:replicate(ptr_new(bytarr(20996)),4)}
>> openr,lun,'example.bin',/get
>> readu,lun,*(a.data)[0]
>> free_lun,lun
>
>> print, (*(a.data)[0])[0:10] ; prints the first bytes
>
>> You can make the structure more complex if you have to read for example
>> records of byte, float and other types. Then you have to define a
>> structure with placeholders for these types. You can replicate this
>> structure to the number of records. And then the whole file could be
>> read at once.
>
> With all due respect to Reimar, this is NOT the kind
> of thing you should be laying on a guy who is struggling
> to understand the basics of programming! Give the
> guy a break. Simple, simple, simple. He can learn the
> rest later. :-)
>
> 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.")- Hide quoted text -
>
> - Show quoted text -

Well,

The only way i am going to look at this is that there are many
possible solutions to a problem, some simple and some complicated.
True. I am new to programming and am still learning. This is a good
chance for me to learn about structures,pointers, automation etc. and
relate them to my work. I would never learn to use these concepts
unless i apply them somewhere. As long as i learn something new
everyday, i'm adding something. Thats what matters. Thanks for all
your replies and suggestions. I will try them all, understand them,
and use them such that the code works.

Thanks,
Raghu
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Interactive Image Locations and Values
Next Topic: iTools hardware rendering

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

Current Time: Mon Apr 27 16:24:09 PDT 2026

Total time taken to generate the page: 0.24141 seconds