×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

what this code means?

what this code means?

what this code means?

(OP)
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.

RE: what this code means?

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.

  

RE: what this code means?

(OP)
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.

RE: what this code means?

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.

RE: what this code means?

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...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close