From: CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 15-SEP-1988 01:38 To: ARISIA::EVERHART Subj: RE: Emulating argc/argv in VMS (using Pascal)... Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Wed, 14 SEP 88 10:07:29 PDT Received: from gold.bacs.indiana.edu by KL.SRI.COM with TCP; Wed, 14 Sep 88 09:41:47 PDT Date: 14 Sep 88 11:36:00 EST From: "IVAX::IJAH400" Subject: RE: Emulating argc/argv in VMS (using Pascal)... To: "info-vax" njin!limonce@rutgers.edu (Tom Limoncelli) writes in message i.d. : < I am writing a program in VaxPascal. I need to be able to pass it < parameters. I've been messing with Lib$Get_foreign and it's not < working. It asks for the parameter from sys$input no matter < what. Since we don't have v5.0 yet (we're still running v4.7), I don't have the PL/1 example; but given below is an example of using LIB$GET_FOREIGN from a Pascal program. If you want prompting if no arguments are given, see the description of the user_prompt and force_prompt arguments in the entry for LIB$GET_FOREIGN in the Run-Time Library Routines Reference Manual... [PHOTO: Recording initiated 14-SEP-1988 11:07] $ type example.pas [inherit ('SYS$LIBRARY:STARLET')] program example (output); type string = varying [256] of char; unsigned_byte = [byte] 0..255; unsigned_word = [word] 0..65535; var status: integer; command_line: string; [external] function LIB$GET_FOREIGN ( %descr GET_STR : [writeonly] varying [u1] of char; %descr USER_PROMPT : [readonly] varying [u2] of char := %immed 0; %ref OUT_LEN : [writeonly] unsigned_word := %immed 0; %ref FORCE_PROMPT : [readonly] integer := %immed 0) : integer; extern; begin { example } status := LIB$GET_FOREIGN (GET_STR := command_line); if odd(status) then writeln(output,'LIB$GET_FOREIGN returned ',command_line) else $EXIT(status) end { example }. $ pascal example $ link example $ run example LIB$GET_FOREIGN returned $ example :== $sys$disk:[]example $ example LIB$GET_FOREIGN returned $ example just echos the command line LIB$GET_FOREIGN returned JUST ECHOS THE COMMAND LINE $ example "use quotes to preserve case" LIB$GET_FOREIGN returned "use quotes to preserve case" $ logout Process PHOTO_6E2E logged out at 14-SEP-1988 11:08:42.19 [PHOTO: Recording terminated 14-SEP-1988 11:08 EXAMPLE.LOG;1] Hope this helps... - Jim Harvey, Analyst/Programmer, IUPUI Computing Services ijah400@indyvax (bitnet) or ijah400%ivax.decnet@gold.bacs.indiana.edu