home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / fortran / 4208 < prev    next >
Encoding:
Text File  |  1992-11-05  |  2.5 KB  |  89 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!snorkelwacker.mit.edu!ira.uka.de!news.belwue.de!news.uni-ulm.de!news
  3. From: KARGL@rzmain.rz.uni-ulm.de (ComRam)
  4. Subject: Problem using $GETUAI
  5. Message-ID: <1992Nov5.184235.12119@wega.rz.uni-ulm.de>
  6. Sender: news@wega.rz.uni-ulm.de (News Net)
  7. Organization: Chaos Computer Club Ulm
  8. Date: Thu, 5 Nov 1992 18:42:35 GMT
  9. X-News-Reader: VMS NEWS 1.24
  10. Lines: 77
  11.  
  12. Starting with the problem of finding the Real Name to a given Account I
  13. first wrote a little C program which does the job and works quite fine.
  14. Then I started to do the same thing in FORTRAN (Just for fun:-) and this
  15. one refuses to work. The SYS$GETUAI returns a SS$_BADCONTEXT. Can anyone
  16. tell me whats wrong with this thing?
  17.  
  18. --------------------------------------------------------------------------
  19.  
  20. * FINDREAL.FOR --- Find Owner Name --- (C) 1992 by ComRam
  21.  
  22.     PROGRAM Findreal
  23.  
  24.     IMPLICIT NONE
  25.     
  26.     INCLUDE '($JPIDEF)'
  27.     INCLUDE '($UAIDEF)'
  28.  
  29.     CHARACTER*12   Username
  30.     CHARACTER*32   Owner
  31.  
  32.     INTEGER Usernamelen,
  33.     1    Ownerlen,
  34.     2    Status,
  35.     3    I
  36.  
  37.     INTEGER SYS$GETJPI,
  38.     1    SYS$GETUAI
  39.  
  40.     STRUCTURE /ITMLST/
  41.        INTEGER*2 BUFLEN,
  42.     1            CODE
  43.        INTEGER*4 BUFADR,
  44.     1            RETLENADR
  45.     END STRUCTURE
  46.     
  47.     RECORD /ITMLST/ JPI_LIST,
  48.     1        UAI_LIST
  49.     
  50.     JPI_LIST.BUFLEN       = 12
  51.     JPI_LIST.CODE         = JPI$_USERNAME
  52.     JPI_LIST.BUFADR       = %LOC (Username)
  53.     JPI_LIST.RETLENADR    = %LOC (Usernamelen)
  54.  
  55.     Status = SYS$GETJPI (,,,JPI_LIST,,,)
  56.     
  57.     WRITE (*,*) '*',Username(1:Usernamelen),'*'
  58.  
  59.     DO I=Usernamelen,1,-1
  60.        IF (Username(I:I) .NE. ' ') GOTO 10
  61.     ENDDO
  62. 10    CONTINUE
  63.  
  64.     WRITE (*,*) 'I : ',I,'  Username : *',Username(1:I),'*'
  65.     
  66.     UAI_LIST.BUFLEN       = 32
  67.     UAI_LIST.CODE         = UAI$_OWNER
  68.     UAI_LIST.BUFADR       = %LOC (Owner)
  69.     UAI_LIST.RETLENADR    = %LOC (Ownerlen)
  70.  
  71.     Status = SYS$GETUAI (0,0,%DESCR(Username(1:I)),UAI_LIST,0,0,0)
  72.  
  73.     WRITE (*,*) 'Status : ',Status,'  Owner : ',Owner
  74.  
  75.     STOP
  76.     END
  77.  
  78. ------------------------------------------------------------------------------
  79.  
  80.  
  81.  
  82. ------------------------------------------------------------------------------
  83.  ComRam  (in real life : Frank Kargl)    Student consultant for programming
  84.  IP            : COMRAM@RZ.UNI-ULM.DE    University of Ulm          Germany
  85.  DECnet(Belwue) : 50186::KARGL           All statements posted above are
  86.  Bitnet       : KARGL@DULRUU51.BITNET    my personal oppinion ONLY !
  87. ------------------------------------------------------------------------------
  88.     God created INTEGERS ... everything else was defined by mathematicians
  89.