 |
» |
|
 |
|
 |

Copyright (c) Digital Equipment Corporation 1989. All rights reserved
LAYERED PRODUCT: PL/I V3.3, SCAN V1.1 OP/SYS: VMS Version 5.2
SOURCE: Digital Customer Support Center
OVERVIEW:
These programs demonstrate how to pass variable length strings from
a PL1 program to a VAX SCAN program, then pass the strings back again.
*** CAUTION ***
This sample program has been tested using: PL1 V3.3, SCAN V1.1 on VMS V5.2.
However, we cannot guarantee its effectiveness because of the possibility of
errors 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 the following command procedure is invoked, the necessary programs will
be created, compiled, linked, and run.
COMMAND FILE:
$ pli/obj=main sys$input
papa: procedure options(main);
dcl sub external entry (any char(*),any char(*),any char(*),any char(*));
dcl (s1,s2,s3,s4) char(255) varying;
s1='123'; s2='4567890';
call sub ( ref(s1), ref(s2), s3, s4 );
put list( 's1: ', s1, ' len=',length(s1)) skip;
put list( 's2: ', s2, ' len=',length(s2)) skip;
put list( 's3: ', s3, ' len=',length(s3)) skip;
put list( 's4: ', s4, ' len=',length(s4)) skip;
end;
$!-------------------------------------------------------
$ scan/obj=sub sys$input
module subroutine;
! take parameters from pl/i and display lengths for first two and
! return values in the other two.
procedure sub (
s1: string,
s2: string,
s3: string,
s4: string );
write 'len(s1)= ', length( s1 );
write 'len(s2)= ', length( s2 );
s3 = 'abcdef';
s4 = 'wxyz';
end procedure; /* subroutine
end module; /* subroutine
$!----------------------------------------------------------
$ link main,sub
$ run main
|
buy online or call 1.800.AT.COMPAQ
|
|