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

Home » Public Forums » archive » ASSOC and structures - structure size problem
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: ASSOC and structures - structure size problem [message #8868 is a reply to message #8807] Fri, 02 May 1997 00:00 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
sdpp@anitesystems.co.uk (Steve Phillips) writes:


> I'm trying to use ASSOC to link a structure with a large file.

> The structure consists of lonarr(48) followed by intarr(14423). This pattern
> being repeated 16036 times in the file.

> I ASSOC the structure with the file (including 16252 byte offset for a file
> header)

> The structure size should be 29038 bytes , but HELP,/STRUCT gives it as 29040.

> I would accept the 2 byte difference as a structure ID or something. But the
> data values I'm getting are all wrong - suggesting that ASSOC is not mapping
> the structure onto the file correctly, or it's using the wrong structure size
> ?

> Can anyone explain this anomaly.

> I'm using DEC Unix 3.2 on an Alpha.

I suspect that what is happening is that the structure is being padded to end
on a word boundary. You should be able to read in the first instance of your
structure correctly, but the alignment will be wrong for any others, so you'll
read in garbage data.

An alternative way to read the file would be to use the commands POINT_LUN to
move to a specific byte in the file, and READU to read in the data. For
example, if you wanted to read in the third structure, you'd enter the commands

IDL> POINT_LUN, UNIT, 16252 + 2*29038
IDL> READU, UNIT, MY_STRUCT

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Windows selection in PV-Wave
Next Topic: Re: PRINTING IN IDL4.0

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

Current Time: Sun Nov 30 11:23:53 PST 2025

Total time taken to generate the page: 0.23721 seconds