Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Using CLI Routines from VAX Pascal
@ 1990-02-02 20:57 jogle
  1990-02-04 13:40 ` Martin v.d. Boogaard
  0 siblings, 1 reply; 4+ messages in thread
From: jogle @ 1990-02-02 20:57 UTC (permalink / raw)



 Hello all,

    I am trying to use the VAX Command Line Interface Runtime Routines
 (CLI) from within a VAX Pascal program.  The problem I am having is that
 I can't seem to find the system file to include that contains all the
 return codes for these routines.  (e.g. CLI$_NORMAL, CLI$_PRESENT, etc).
 Are these codes defined in starlet.pas or is there another file that
 my system seems to be missing?

    Any help would be greatly appriciated.  Please E-mail replies.


                                           Thanks in advance,

                                            -- jogle
                                               !rutgers!soleil!geigel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using CLI Routines from VAX Pascal
  1990-02-02 20:57 Using CLI Routines from VAX Pascal jogle
@ 1990-02-04 13:40 ` Martin v.d. Boogaard
  1990-02-06 22:19   ` Erland Sommarskog
  0 siblings, 1 reply; 4+ messages in thread
From: Martin v.d. Boogaard @ 1990-02-04 13:40 UTC (permalink / raw)


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.

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using CLI Routines from VAX Pascal
  1990-02-04 13:40 ` Martin v.d. Boogaard
@ 1990-02-06 22:19   ` Erland Sommarskog
  0 siblings, 0 replies; 4+ messages in thread
From: Erland Sommarskog @ 1990-02-06 22:19 UTC (permalink / raw)


Martin v.d. Boogaard (nboogaar@ruunsa.fys.ruu.nl) writes:
>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.
>...
>          CLI$_COMMA           =  %X'3FD39';
>etc.

If you declare them as

VAR
   CLI$_Comma : (.External, Value.) unsigned;

you don't have to bother about hard-coded values. Not obvious,
but it seems to work.

What is missing though is a PASCAL$CLI_ROUTINES to supplement the
other nice environments shipped with V5.
-- 
Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se
Unix is a virus.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using CLI Routines from VAX Pascal
@ 1990-02-07  9:20 vanavermaet
  0 siblings, 0 replies; 4+ messages in thread
From: vanavermaet @ 1990-02-07  9:20 UTC (permalink / raw)


[ inherit('STANDARD_DISCLAIMER') ]

In article <932@soleil.UUCP>, geigel@soleil.UUCP (jogle) writes...
[...]
> I can't seem to find the system file to include that contains all the
> return codes for these routines.  (e.g. CLI$_NORMAL, CLI$_PRESENT, etc).

You could simply declare them as follows:

var
    CLI$_PRESENT : [ external, value ] unsigned;

In general, in Vax/VMS, most such symbols can be resolved by two means:

1. during the compilation - for Pascal, that often means  
   [ inherit('SYS$LIBRARY:STARLET') ]

2. during the link - as shown above

For some groups of symbols, only one method is available.

Regards,
Peter Van Avermaet
Digital Equipment, E.I.S. Europe, Application Development Group (Brussel site)
InterNet:	vanavermaet@player.dec.com or vanavermaet%player.dec.com@decwrl.dec.com
UUCP:		node-1!node-2!...!decwrl!player.dec.com!vanavermaet or vanavermaet@player.dec.com
Phone:		+32 2 244 7959
Snailmail:	Luchtschipstraat 1
		1140 Brussel
		Belgium


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1990-02-07  9:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1990-02-02 20:57 Using CLI Routines from VAX Pascal jogle
1990-02-04 13:40 ` Martin v.d. Boogaard
1990-02-06 22:19   ` Erland Sommarskog
  -- strict thread matches above, loose matches on Subject: below --
1990-02-07  9:20 vanavermaet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox