Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Unformatted Sequential vs Binary

morandin
Beginner
817 Views
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
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
817 Views
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.
0 Kudos
morandin
Beginner
817 Views
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.
0 Kudos
Reply