HP3000-L Archives

February 2002, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Gavin Scott <[log in to unmask]>
Reply To:
Gavin Scott <[log in to unmask]>
Date:
Mon, 4 Feb 2002 17:14:55 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (44 lines)
Cecile points out:
> In a message dated 2/4/02 2:01:20 PM Eastern Standard Time,
> [log in to unmask] writes:
> > I thought FSET was supposed to reset the file number.

>        CALL FSET(FNUM13,FSET13,IERR)

> FSET is resetting the file number.  It is resetting it to what you are
> telling it to set it to.  You are telling it to reset it to itself.  I
> don't know why you are doing that.

Oh, well, duh, no wonder it doesn't work.

The FSET function changes the MPE "file number" (the thing returned by
FOPEN) assigned to a FTN logical unit to whatever value you specify for the
second parameter, and returns the old assignment in the third parameter.
You would do this, for example, if you called an external XL procedure (or
FOPEN/HPFOPEN directly) that returned a file number and you then wanted to
do FORTRAN I/O via a FTN logical unit number to this file and thus needed to
tell FORTRAN to associate the MPE file number with some particular unit
number.

Don's trace:

  AFTER FSET(13), FNUM13: 13 FSET13: 21 IERR: 1019
  AFTER FSET(14), FNUM14: 14 FSET14: 22 IERR: 1020

shows that unit 13 was already assigned file number 1019 by the FOPEN that
FORTRAN did on your behalf, and that you're now explicitly setting it to
"21" (it looks like) for some reason.

Once you do this, the program will have no more knowledge of the existence
of file open number 1019, and so there will be no way that anything will
ever closes this file.  Hence, the FSETs are responsible for the files open
on unit 13 and 14 being "lost" to the program and thus remain open forever.

Delete the FSET calls from the code.  I don't know what you thought FSET was
doing, but it's clearly not what you intended.

G.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2