From:	CSBVAX::MRGATE!BARMSTRO@carleton.edu@SMTP 11-MAY-1988 22:35
To:	ARISIA::EVERHART
Subj:	RE: quoted string in VAX Pascal -- using conformant arrays


Received: from RELAY.CS.NET by KL.SRI.COM with TCP; Fri 6 May 88 06:17:09-PDT
Received: from relay2.cs.net by RELAY.CS.NET id aa10787; 5 May 88 22:11 EDT
Received: from carleton.edu by RELAY.CS.NET id ad01894; 5 May 88 22:03 EDT
Date: Thu, 5 May 88 10:32 CST
From: Pod Stolom Consulting <BARMSTRO%carleton.edu@RELAY.CS.NET>
Subject: RE: quoted string in VAX Pascal -- using conformant arrays
To: info-vax@KL.SRI.COM
X-VMS-To: IN%"info-vax@kl.sri.com"

VAX Pascal has what it calls conformant parameters.  This will work with
all sorts of arrays, including packed of char and varying of char.  

program foo(output);
Procedure check_error
  (	return_status	: unsigned;
	message_1	: packed array [l1..u1:integer] of char;
	message_2	: varying [l$] of char);
begin
	lib$signal(return_status, message_1, message_2)
end;

begin
    	check_error (UTILITY_FILNOTFND, message_1, "operator.log")
end.

Things to remember:  l1, u1, and l$ are all _implicitly declared variables_
(sounds like Fortran to you to, eh?) and therefore can only be used once
in a given procedure declaration (otherwise they'd be multiple defined,
and you get ugly compile time stuff).  Just like any other identifier, they
can be full of $ and _.

One other trick is that the routine declaration be need to be in a different
module from the caller.  I am pretty sure that I'm thinking of something
else, but I wanted to mention it just in case.

Good luck.


+-----------------------------------------------------------------------+
| Borden Armstrong                               Computer Center        |
| System Manager and                             Carleton College       |
| Academic Programmer/Analyst                    1 North College Street |
|                                                Northfield, MN  55057  |
| barmstro@carleton.edu                                     U. S. A.    |
| ...!umn-cs!stolaf!agnes!ccnfld!barmstro        (507)663-4277          |
+-----------------------------------------------------------------------+

