[comp.os.vms] Using VMS MESSAGE and VAX Pascal

adrian@mti.mti.com (Adrian McCarthy) (01/16/90)

Can somebody give me a clue on passing FAO (Formatted ASCII Output facility)
string parameters when using the VMS MESSAGE facility in conjuction with
LIB$SIGNAL via Pascal?  I must have a mistake in the parameter passing.

Here is TESTMSG.MSG:
------
.FACILITY TEST,1/PREFIX=TEST_
.SEVERITY INFORMATIONAL
SYNTAX  "This is a test."
STRING  "The string is:  !AS."/FAO_COUNT=1
NUMBER  "The number is:  !SL."/FAO_COUNT=1
.END
------

Here is TEST.PAS:
------
[inherit('sys$library:pascal$lib_routines')]  {This gets the lib$signal decl.}

program test(input,output);

var
  test_syntax : [external,value] integer;
  test_string : [external,value] integer;
  test_number : [external,value] integer;

  string : varying[100] of char := 'This is a test string.';
  number : integer := 42;

begin
{The examples shown below are generated by uncommenting each of the following
lines, one at a time:}
(*
  lib$signal(test_syntax);  
  lib$signal(test_string,1,iaddress(string.body));
  lib$signal(test_number,1,number);
*)
end.
------

I compile with the following sequence:
------
$ message testmsg.msg
$ pascal test.pas
$ link test,testmsg
------

Here's what I get:
------
%TEST-I-SYNTAX, This is a test.
%TEST-I-STRING, The string is:  !AS.
%TEST-I-NUMBER, The number is:  42.
------

The first and third cases work fine, but the second doesn't translate.  I've
tried passing IADDRESS(string), but that doesn't work either.  Do I have to
build a string descriptor of some sort?  What's the trick?

(I'm running VMS V5.1-1. MESSAGE 04-92, and Pascal V3.9-289.)  E-mail, and
I'll post result.

Thanks in advance,
Aid.