🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #5544

Re: Using CLI Routines from VAX Pascal

#5544
From: Martin v.d. Boogaard
Date: Sun, 04 Feb 1990 13:40
140 lines
5622 bytes
Sorry to post this solution instead of mailing it. I've already wasted
enough time trying to reach people without decent Internet or BITnet
addresses. Below is my solution to the question of communication between
VAX Pascal and CLI. CLI is the only decent way to get VAX Pascal to detect
command line parameters. We finally found the values of CLI$_PRESENT etc.
in a C include file (see comments below). Don't ask me why DEC didn't include
info like this in its documentation on CLI and CDU.

Good luck,


Martin J. van den Boogaard          
                                        
Dept. of Atomic & Interface Physics, Rijksuniversiteit, Utrecht

                                       P.O. Box 80.000
decnet:   ruunsc::boogaard             NL-3508 TA  Utrecht
bitnet:   boogaard@hutruu51.bitnet     the Netherlands
internet: nboogaar@fys.ruu.nl          +31 30 532904

-----------------------------------cut here------------------------------------

 module Pl_sys_decl;

 { Library of Pascal routines for use under VAX VMS.
   Martin J. van den Boogaard
   Dept. of Atomic and Interface Physics, R.U. Utrecht

   Declarations for Pl_sys routines. }

 {############################################################################}

 type     Byte_uns      =  [byte] 0..255;
          Word_uns      =  [word] 0..32767;
          Longword_uns  =  [long] unsigned;

 {############################################################################}

 const    Pl_sys_line_length   =  80;

         {The following constants define so-called condition values, as they
          are returned by system routines. This enables the programmer to
          adhere to the notational conventions used in the DEC manuals. Off
          course, these constants may be changed in a new VMS release! On node
          RUUNSC (HUTRUU51) the information below was found in the following
          text libraries on directory SYS$LIBRARY:

            FORSYSDEF.TLB, module $SSDEF ;
            VAXCDEF.TLB,   module CLIMSGDEF.

          Our VMS release is 5.1-1. Check your local files or system manager
          to see if the constants in this module are up-to-date.}

          SS$_NORMAL           =  %X'00001';
          CLI$_COMMA           =  %X'3FD39';
          CLI$_CONCAT          =  %X'3FD29';
          CLI$_ABSENT          =  %X'381F0';
          CLI$_PRESENT         =  %X'3FD19';
          CLI$_NEGATED         =  %X'381F8';
          CLI$_LOCPRES         =  %X'3FD31';
          CLI$_LOCNEG          =  %X'38230';
          CLI$_DEFAULTED       =  %X'3FD21';

 {############################################################################}

 type     Pl_sys_line   =  varying [Pl_sys_line_length] of char;

 {############################################################################}

 [ external, asynchronous ] function CLI$GET_VALUE

   ( %stdescr Entity_desc:
                         packed array [ F1..L1: integer ] of char := %immed 0 ;
     %stdescr Retdesc:   packed array [ F2..L2: integer ] of char := %immed 0 ;
     %ref     Retlength: Word_uns := %immed 0 ):

     Longword_uns; external;

 {############################################################################}

 [ external, asynchronous ] function CLI$PRESENT

   ( %stdescr  Entity_desc:
                        packed array [ F1..L1: integer ] of char := %immed 0 ):

     Longword_uns; external;

 {############################################################################}

 end.

 {############################################################################}

-----------------------------------cut here------------------------------------

[inherit('pl_sys_decl.pen')]

module Pl_sys_cli (input, output);

{ Library of Pascal routines for use under VAX VMS.
  Martin J. van den Boogaard
  Dept. of Atomic and Interface Physics, R.U. Utrecht }

{############################################################################}

[global]
function Pl_sys_cli$get_value
           ( Entity_desc:     packed array [ Ef..El: integer ] of char;
             var Retdesc:     varying [ Rl ] of char ):
         integer;

{ Returns, in Retdesc, CLI entity described by Entity_desc. }

var Ret:         packed array [ 1..Pl_sys_line_length ] of char;
    Retlength:   Word_uns;

begin
  Pl_sys_cli$get_value :=
                         int (CLI$GET_VALUE ( Entity_desc, Ret, Retlength ) );
  Retdesc := substr ( Ret, 1, Retlength );
end;

{############################################################################}

[global]
function Pl_sys_cli$present
           ( Entity_desc:     packed array [ Ef..El: integer ] of char ):
         integer;

{ Determines the presence of the CLI entity described by Entity_desc. }

begin
  Pl_sys_cli$present := int ( CLI$PRESENT ( Entity_desc ) );
end;

{############################################################################}

end.

{############################################################################}
Technical Details
Message-ID: <480@ruunsa.fys.ruu.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!ruuinf!ruunsa!nboogaar
References: <932@soleil.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!ruuinf!ruunsa!nboogaar
From: nboogaar@ruunsa.fys.ruu.nl (Martin v.d. Boogaard)
Newsgroups: comp.sys.dec,comp.os.vms,comp.lang.pascal
Subject: Re: Using CLI Routines from VAX Pascal
Keywords: CLI, VAX, Pascal
Message-ID: <480@ruunsa.fys.ruu.nl>
Date: 4 Feb 90 13:40:24 GMT
References: <932@soleil.UUCP>
Reply-To: nboogaar@ruunsa.fys.ruu.nl (Martin v.d. Boogaard)
Followup-To: comp.sys.dec
Organization: Physics Department, University of Utrecht
Lines: 140