HP3000-L Archives

July 2000, Week 4

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:
Reply To:
Ted Ashton <[log in to unmask]>
Date:
Tue, 25 Jul 2000 17:03:09 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (75 lines)
Thanks for the help, one and all.  The story is that when you do a
  files #1,#3
sort of statement, the #s don't relate to the numbers in the previous
segment, they refer to a global table.  Each new "files" statement adds it's
files onto the end of that table.  If a segement INVOKES another segment,
the first segments files remain as part of that global table.  If, instead,
it CHAINS the segment, its table entries are removed (and the files closed).
Table entries are also removed when a segment ends.  In my case, segment 00
opened a write-only file, number 1:

>files
1  REGLOG

Then it invoked segment 21 which opened got access to file 1 and opened one
of its own:

>files
1  REGLOG
2  #1
3  BOOKCMPT.CSHOP.ADMIN
LOCAL FILES START AT 2

Notice that file 2 is taken up with *local* access to the *global* file 1, so
the locally-opened BOOKCMPT counts as file 3.  Note also the "LOCAL FILES
START AT 2".  That means that a PRINT #1 is accessing *global* file 2 (and,
due to the linkage, global file 1) and that a MAT READ #2 is reading from
*global* file 3.

Then segment 21 invoked segment 22.  This is the spot where the trouble arose
in the first place.  I need to write to REGLOG and read from BOOKCMPT.  What
numbers should I put in the files statement?  It seems NOW to be clear that
we want
  files #1,#3
and that is truly the case.  Once segment 22 is underway (the files statment
can go anywhere in the program _because_ it acts immediately upon segment
startup), the situation looks like this:

>files
1  REGLOG
2  #1
3  BOOKCMPT.CSHOP.ADMIN
4  #1
5  #3
LOCAL FILES START AT 4

I do PRINT #1 and the data goes to file 4 and, due to the linkage, out to
REGLOG.  I do READ #2 and the data comes from file 5 and thus from BOOKCMPT.
At the end of that segment, I ASSIGN *,2, and immediately upon the start of
segment 23 (INVOKEd from segment 22), we have

>files
1  REGLOG
2  #1
3  *
4  #1
5  #3
6  #1
LOCAL FILES START AT 6

and as the segments end, the files go away until we return to segment 00 with
only file 1 open.

Ted
--
Ted Ashton ([log in to unmask]), Info Sys, Southern Adventist University
          ==========================================================
Every mathematician worthy of the name has experienced ... the state of
lucid exaltation in which one thought succeeds another as if miraculously...
this feeling may last for hours at a time, even for days. Once you have
experienced it, you are eager to repeat it but unable to do it at will,
unless perhaps by dogged work...
                         -- Weil, Andre (1906 -?)
          ==========================================================
         Deep thoughts to be found at http://www.southern.edu/~ashted

ATOM RSS1 RSS2