home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 22232 < prev    next >
Encoding:
Text File  |  1993-01-28  |  3.1 KB  |  63 lines

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