|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
viroxa
Joined: 28 Jul 2017 Posts: 78
|
Posted: Mon Aug 14, 2017 4:08 pm Post subject: READ* causes run-time error after file has been opened/close |
|
|
Hello, everyone,
I opened a file using
Code: | OPEN(UNIT=1,FILE='...',STATUS='old',IOSTAT=stats) |
after reading data from that file, I closed it again, using
After that, READ* - which should get user input from the command promt returns
Quote: | "Run-time error 94: Unit has neither been OPENed nor preconnected" |
PRINT*,'...' on the other hand, works just fine.
How can I open the command prompt for input again?[/quote] |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Mon Aug 14, 2017 4:31 pm Post subject: |
|
|
I think that it is advisable not to use low-numbered units in an OPEN statement, as the idea is that they are 'pre-connected'. Old-fashioned advice was to avoid units 5 and 6, because traditionally they were the card reader (5) and line-printer (6). On the first machine I ever used, 1 was the operator's console, 2 and 3 were tape readers, and 4 was the tape punch. 7 was another card reader!
If you are using a pre-connected unit, never CLOSE it, or you are likely to get the problems you describe. A unit number given as * is also pre-connected. If a UNIT is pre-connected, you do not need to OPEN it.
The advice given in FTN95.CHM is: "UNIT values should be greater than 6 to avoid the possibility of re-assigning standard input/output streams."
Eddie |
|
Back to top |
|
|
viroxa
Joined: 28 Jul 2017 Posts: 78
|
Posted: Mon Aug 14, 2017 5:17 pm Post subject: |
|
|
Thanks for the detailed explanation!
I'm working with code that someone had written back in the 90's. They only excluded 5 and 6. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|