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

Home » Public Forums » archive » Re: reading unformatted data into a structure
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: reading unformatted data into a structure [message #29729 is a reply to message #29726] Tue, 19 March 2002 09:23 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rick Towler (tsehai@attbi.com) writes:

> I actually want the ASCII characters that the char array refers to.
> Interestingly, when I do use the string function I get a blank line. I have
> tried different format statements to no avail.
>
> IDL> print,header.datum
> 0 0 87 71 83 56 52 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0
> IDL> print,string(header.datum)
>

It's hard to know what this should be. I agree with
previous posters that you may have structure alignment
problems. But, typically, if a string were set to bytes
then blank characters would have the value 32, not 0.
(I don't know what the ASCII character is for 0B.)

But, if you do this:

IDL> indices = Where(header.datum EQ 0, count)
IDL> IF count GT 0 THEN header.datum[indices] = 32B
IDL> Print, String(header.datum)
WGS84

I don't know why this works, exactly. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Image editing with IDL?
Next Topic: days of the week

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

Current Time: Fri Oct 10 13:27:01 PDT 2025

Total time taken to generate the page: 1.28045 seconds