Jump to page titleUNITED STATES
hp.com home products and services support and drivers solutions how to buy
» contact hp

:

more options
 

hp.com home
End of Jump to page title
Example PL1,SCAN Passing Strings From PL1 Program To SCAN And Back
Jump to content



» 

business support center

Home & Home Office Support:
» HP branded products
» Presario branded products
» Services & Warranties
Small & Medium Business Support:
» Small & Medium Business products
» Small & Medium Business services
Support for IT Professionals:
» Enterprise products (IT Resource Center)
» NonStop enterprise products
» Business & IT Services
Content starts here
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
privacy statementusing this site means you accept its terms