home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / vms / 14199 < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.3 KB  |  52 lines

  1. Path: sparky!uunet!walter!att!ucbvax!ko.hhs.dk!ARNE
  2. From: ARNE@ko.hhs.dk (Arne Vajhxj)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Command string from within VAX/VMS Pascal ???
  5. Message-ID: <052DCE714ABFC0C81E@sb.hhs.dk>
  6. Date: 26 Aug 92 12:13:00 GMT
  7. Sender: usenet@ucbvax.BERKELEY.EDU
  8. Organization: The Internet
  9. Lines: 41
  10.  
  11. Someone, which did not supply an email-address, asked:
  12.  
  13. > Could somebody tell me how to retrieve the command string
  14. > from within VAX/VMS Pascal, including the path,program name
  15. > and on-line parameters ?
  16.  
  17. Look for LIB$GETJPI and LIB$GET_FOREIGN !
  18.  
  19. Small example:
  20.  
  21. [inherit('sys$library:pascal$lib_routines','sys$library:starlet')]
  22.  
  23. program z(input,output);
  24.  
  25. var
  26.    img,cmd : varying [512] of char;
  27.  
  28. begin
  29.    lib$getjpi(item_code:=JPI$_IMAGNAME,
  30.               resultant_string:=img.body,resultant_length:=img.length);
  31.    lib$get_foreign(resultant_string:=cmd.body,resultant_length:=cmd.length);
  32.    writeln('Image = ',img);
  33.    writeln('Command line = ',cmd);
  34. end.
  35.  
  36. To test try:
  37.  
  38.   PAS Z
  39.   LIN Z
  40.   Z:==$disk:[dir]Z
  41.   Z "kuk"
  42.  
  43. Hope it helps !
  44.  
  45.                                                           Arne
  46.  
  47. Arne Vajhxj                             local DECNET:  KO::ARNE
  48. Computer Department                     PSI:           PSI%23831001304030::ARNE
  49. Business School of Southern Denmark     Internet:      ARNE@KO.HHS.DK
  50.  
  51.  
  52.