how to define a struct header of fixed length in IDL [message #44847] |
Sun, 17 July 2005 07:04 |
rzsh5
Messages: 4 Registered: July 2005
|
Junior Member |
|
|
hi,all
I have met a problem in write a binary file in IDL. In my output
file, I need to write a header with 1024 byte length first, and then
output the data(5*5). I have defined a struct array for the header
which includes different data types (string, Long, Integer), But how to
define a string type variable with fixed length, for example, char*
a[20]? my header is just like the following, but I can't read it out.
please help me, thanks.
struct={header,
Sat:'',Product:'',Unit:'',Year:1,Day:1,Hour:1,Mini:1,Lat_m ax:1.0,Lat_min:1.0,Lon_max:1.0,Lon_min:1.0,Project:'',R_ lat:1.0,R_lon:1.0,Row:1,Col:1,Slope:1.0,Offset:1.0,spare :''}
where, for Sat,Product and Unit, Project, The length is char*20.
I use writeu to write the header into file, and readu to get the header
out, but failed.
|
|
|