 |
» |
|
 |
|
 |

Copyright (c) Digital Equipment Corporation 1990, 1991. All rights reserved
LAYERED PRODUCT: VAX PL/I, V3.4 OP/SYS: VMS, V5.4
SOURCE: Digital Customer Support Center
OVERVIEW:
*** CAUTION ***
This sample program has been tested using VAX PLI V3.4 on VMS V5.4.
However, we cannot guarantee its effectiveness because of the possibility
of error in transmitting or implementing it. It is meant to be used as a
template for writing your own program and it may require modification for
use on your system.
PROGRAM NOTES:
When linking a VAX PL/I program against a PLI object that resides in a
sharable image, this error message may appear:
%LINK-E-OUTSIMG, attempted store location %X00000200 is outside image
binary (%X00000000 to %X00000000)
in psect SYSPRINT module TEST file DISK$USER:[USER]TEST.OBJ;1
-LINK-E-NOIMGFIL, image file not created
PROGRAM:
Create the following files. Then compile and link them with the commands
given below:
TEST.PLI
test:proc options(main);
dcl sub1 entry;
put skip list ('main program');
call sub1();
end test;
SUB1.PLI
sub1:proc;
put skip list('subroutine');
end sub1;
OPTFILE.OPT should contain this line:
UNIVERSAL=SUB1
OPTFILEM.OPT should contain this line:
SUB1/SHARE
$ PLI TEST.PLI
$ PLI SUB1.PLI
$ LINK/SHARE SUB1.OBJ,OPTFILE/OPT
$ DEFINE SUB1 DISK:[DIRECTORY]SUB1
$ LINK TEST,OPTFILEM/OPT
Here are 2 subroutine examples that demonstrate how to get around the link
error:
1) Declare an internal file. This file is opened using the TITLE option
that points to SYS$OUTPUT and all subsequent I/O (PUT) is directed to this
file. Note it should be linked like the original SUB1.
sub1:proc;
dcl outfile file internal;
open file(outfile) output title('SYS$OUTPUT');
put file (outfile) skip list('subroutine');
close file (outfile);
end sub1;
2) Use a combination of PUT STRING and LIB$PUT_OUTPUT. This program
should be linked like the original sub1.pli
sub1:proc;
%include lib$put_output;
%include $stsdef;
dcl output_string char(255) varying;
put string(output_string) edit('subroutine')(a);
sts$value = lib$put_output(output_string);
end sub1;
|
buy online or call 1.800.AT.COMPAQ
|
|