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

Home » Public Forums » archive » N_TAGS( , /LENGTH) strange result!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
N_TAGS( , /LENGTH) strange result! [message #13900] Wed, 06 January 1999 00:00 Go to previous message
Luis Oliveira is currently offline  Luis Oliveira
Messages: 4
Registered: November 1998
Junior Member
Hi all readers.

My problem with N_TAGS(?,/LENGTH) is that it's result with some structures
is diferent from the size of the files that That structures originate?!
(Diferences of about 3 or 4 bytes.)

I am using IDL to read some unformated data file that was written with a C
program. The size calculated with the C structures was the same as the size
of that structures in files. N_TAGS gives a diferent value, but when I
write the same structure with IDL to a file, it's size is the same as the C
structures!

My IDL version is 5.11 in a windows95 PC.

Thanks for any light on this subject...

Luis

PS: After some tests, I've seen that this happens with structures that have
members that are structures... here goes an example:

IDL> x={a:0L,b:0,c:bytarr(5),d:0B,e:bytarr(3),g:{a:0B,b:0}}
IDL> print,n_tags(x,/length)
20
IDL> x={a:0L,b:0,c:bytarr(5),d:0B,e:bytarr(3),g:{a:0B,b:0},f:0B}
IDL> print,n_tags(x,/length)
24

This two structures only differ by one byte! The real length is 18 and 19.
Now, if I write the structure to a file:

IDL> openw,1,'lixo.txt',/delete
IDL> writeu,1,x
IDL> print,(fstat(1)).size ;To return the size of the file
19
IDL> close,1
[Message index]
 
Read Message
Read Message
Previous Topic: Win32 jacket routines between IDL and third-party DLL
Next Topic: Re: Breaking on Math Warnings?

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

Current Time: Fri Oct 10 09:52:55 PDT 2025

Total time taken to generate the page: 0.71998 seconds