Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!ames!ucbcad!ucbvax!MITBATES.BITNET!CARTER From: CARTER@MITBATES.BITNET (Tony Carter - MIT Bates Linac) Newsgroups: comp.os.vms Subject: Using the message facility with Pascal Message-ID: <8711081007.AA04519@ucbvax.Berkeley.EDU> Date: Wed, 4-Nov-87 14:37:00 EST Article-I.D.: ucbvax.8711081007.AA04519 Posted: Wed Nov 4 14:37:00 1987 Date-Received: Tue, 10-Nov-87 07:33:04 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 45 >The trick is to declare some [EXTERNAL] variables with the same name as >the condition code symbols that you defined in your message file. Close, what you really want to use is [EXTERNAL,VALUE]. This will cause the reference to get resolved properly. For example: VAR MSG_MESSAGE : [EXTERNAL,VALUE] UNSIGNED; BEGIN LIB$SIGNAL(MSG_MESSAGE); END. I know the compiler will not let you use the variable on the left hand side of an assignment statement, but I don't know if that means it is handled like a constant or if memory is allocated for it like a variable. As far as how to declare LIB$SIGNAL to get it to like your FAO args, I use: [asynchronous,external] function lib$signal (%immed SigVal : unsigned; %immed FaoCnt : integer :=%immed 0; %stdescr faoargs : [list] packed array[$l0..$u0:integer] of char):unsigned;extern; To use it, you could have: { no FAO args } LIB$SIGNAL(MSG_MESSAGE); { one string arg } LIB$SIGNAL(MSG_MESSAGE,1,'SOME STRING'); { one numeric arg (352) } LIB$SIGNAL(MSG_MESSAGE,1,%IMMED(352)); { one string arg and one numeric arg } LIB$SIGNAL(MSG_MESSAGE,2,'SOME STRING',%IMMED(352)); etc... The %IMMED(352) is necessary because I directed the compiler to pass by CLASS_S string descriptor by default. Obviously, you can insert the appropriate variables in place of the values I used in the example. Tony Carter CARTER@MITBATES (Bitnet) (617) 245-6600 MIT Bates Linac Middleton, MA