dos_compilers/Digital Research PLI-86 v1/SAMPLE.PLI
2024-06-30 12:01:25 -07:00

41 lines
1.0 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

sample:
procedure options(main);
declare
c character(10) varying,
i fixed binary(15);
do;
put skip list('Input: ');
get list(c);
c = upper(c); /* function reference */
put skip list('Output: ',c);
end;
begin;
declare
c float binary(24);
put skip list('Input: ');
get list(c);
call output(c); /* subroutine invocation */
end;
upper:
procedure(c) returns(character(10) varying);
declare
c character(10) varying;
return(translate(c,'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz'));
end upper;
output:
procedure(c);
declare
c float binary(24);
put skip edit(c) (column(20),e(10,2));
end output;
end sample;