- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can I open a unit (a text data file) in the main program and then have a read statement in a subroutine (with the unit still open in the main program) that reads from the same unit/file? do I need to pass the unit number to the subroutine? If so, will multiple calls to the subroutine simply advance the read pointer to the next line each time?
Any help is greatly appreciated!
Cheers!
Boyd
Any help is greatly appreciated!
Cheers!
Boyd
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you can do this. It's your choice as to whether or not to pass the unit number - it's just an integer. Open units are global to the program.
Steve
Steve
![](/skins/images/44D6FBC13D1AFC21DF3F0C7813903D74/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page