Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what this code means?

Status
Not open for further replies.

thepunisher

Programmer
Jul 23, 2004
108
IE
Hi,

Could you tell me what this code below does, and what the variables mean?

I know its opening a file, but i dont know what the UNIT and ORGANIZATION for example mean, i have never coded fortran before.

I am converting this code to VB, so i have to be able to understand it.

OPEN (UNIT=5, ACCESS='SEQUENTIAL', CARRIAGECONTROL='LIST',
+FORM='FORMATTED', ORGANIZATION='SEQUENTIAL', READONLY,
+STATUS='OLD')

Thanks,

thePunisher


The Wolf: Thats 30 minutes away. I'll be there in 10.
 
The unit number will be used as a file reference when reading data from the file. Unit 5 is probably the keyboard. ORGANIZATION refers to the logical file structure. You can omit it in the example as SEQUENTIAL is default.

 
Ok,

but how do i specify the directory of the file i want to read in?


The Wolf: Thats 30 minutes away. I'll be there in 10.
 
In the OPEN statement, the FILE parameter is used to specify the file name. Example : FILE='c:\data\innfile', for a fixed name or FILE=filename where filename is a character variable.
 
Every Fortran implementation has its own rules to define real file names outside a program in (before) run time. So it's a common practice do not define file names in source texts (OPEN stmt) in Fortran World (refer to it via unit number only).
As far as I know, no such (good) feature in VB, so specify file name in VB open when convert Fortran to VB...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top