home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vms
- Path: sparky!uunet!UB.com!pacbell.com!ames!agate!spool.mu.edu!uwm.edu!linac!unixhub!slacvx.slac.stanford.edu!fairfield
- From: fairfield@slacvx.slac.stanford.edu
- Subject: Re: VAX FORTRAN
- Message-ID: <1993Jan28.133752.1@slacvx.slac.stanford.edu>
- Lines: 51
- Sender: news@unixhub.SLAC.Stanford.EDU
- Organization: Stanford Linear Accelerator Center
- References: <27JAN199309324042@rdth2.rdth.luc.edu> <1k7gdaINNn40@gap.caltech.edu>,<1993Jan27.225851.1@slacvx.slac.stanford.edu> <1k8ennINN52q@gap.caltech.edu>
- Date: Thu, 28 Jan 1993 21:37:52 GMT
-
- In article <1k8ennINN52q@gap.caltech.edu>, carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) writes:
- | In article <1993Jan27.225851.1@slacvx.slac.stanford.edu>, fairfield@slacvx.slac.stanford.edu writes:
- |> Geez, Carl, that's about the _ugliest_ fortran I've seen in a long time :-)
- |>How about:
- |
- |> CHARACTER QUEUE_NAME*9, FILE_NAME*8, FORM_NAME*7
- |> PARAMETER (QUEUE_NAME = 'SYS$PRINT',
- |> > FILE_NAME = 'TEST.DAT',
- |> > FORM_NAME = 'DEFAULT')
- |
- |>Or, at the very least:
- |
- |> CHARACTER QUEUE_NAME*9/'SYS$PRINT'/, FILE_NAME*8/'TEST.DAT'/,
- |> > FORM_NAME*7/'DEFAULT'/
- |
- |>You know, the youngsters are _impressionable_!
- |
- | Well, Ken, there's a problem here. You see, SYS$SNDJBC[W] wants, as some of
- | its arguments, pointers to arrrays containing filename, form name, and queue
- | name. It does *NOT* want descriptors for these. That means that the
- | arguments have to be the addresses of arrays, not the addresses of
- | descriptors.
-
- As I've already replied to Carl privately, %LOC does NOT return the
- address of the descriptor, but the address of the "array of characters".
- This is not speculation: I have LOTS of working code that uses %LOC on
- character variables (descriptors) for use with system services in item
- lists. The quoted declarations, above, work AS IS with the rest of
- Carl's sample code unchanged, spcifically the %LOC(QUEUE_NAME), etc.
-
- However, I just checked my Fortran docs, and they are pretty vague
- on this point. To wit, in the _VAX_Fortran_User_Manual_ for VMS V5.0,
- on page 6-8 it states in part:
-
- 6.2.4 Passing Addresses --- %LOC Function
-
- The %LOC built-in function computes the address of a storage element
- as an INTEGER*4 value. You can then use this value in an arithmetic
- expression.
-
- The key phrase is "address of a storage element", and I guess that means
- NOT the address of the descriptor, but the address where the character data
- reside. (Steve Lionel, would you care to comment?)
-
- -Ken
- --
- Dr. Kenneth H. Fairfield | Internet: Fairfield@Slac.Stanford.Edu
- SLAC, P.O.Box 4349, MS 98 | DECnet: 45537::FAIRFIELD (45537=SLACVX)
- Stanford, CA 94309 | BITNET Fairfield@Slacvx
- ----------------------------------------------------------------------------
- These opinions are mine, not SLAC's, Stanford's, nor the DOE's...
-