Unformatted Sequential vs Binary

Unformatted Sequential vs Binary

What is the general difference between a file openned as unformatted sequential and binary? The context of this question is that I have some code that writes a sequence of variables in one write statement to a file openned as unformatted sequential. Subsequently, I am trying to read the same file in some Visual Basic code using Binary access. The VB code does not seem to read the data properly. Is this because unformatted sequential writes the list of variables as 1 record and Binary tries reading each variable as a separate record? If I write the data in FORTRAN code to a file openned using Binary then the VB program reads the data properly.

TIA

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Jugoslav Dujic's picture

Unformatted sequential contains start-of-record and end-of-record markers; binary does not (i.e. it's hard to even imagine concept of "records" in binary). Programmer's Guide discusses that in detail.

Jugoslav www.xeffort.com

Thanks

I figured this out through some small test cases. It happens that the start and end markers are equal to the record length that FORTRAN writes when read as Binary in VB.

Login to leave a comment.