Path: utzoo!attcan!uunet!lll-winken!lll-lcc!lll-tis!ames!pasteur!ucbvax!carleton.EDU!BARMSTRO
From: BARMSTRO@carleton.EDU (Pod Stolom Consulting)
Newsgroups: comp.os.vms
Subject: RE: quoted string in VAX Pascal -- using conformant arrays
Message-ID: <8805120315.AA26943@ucbvax.Berkeley.EDU>
Date: 5 May 88 16:32:00 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 36

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          |
+-----------------------------------------------------------------------+