(* Collection of code snippets by Arne Vajhøj *)
(* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) *)
[inherit('sys$library:starlet')]
program listfun(input,output);

procedure test(v : [list] integer);

type
   string = varying [255] of char;

var
   line : varying [255] of char;
   stat : integer;

begin
   stat := $fao('!SL !SL !SL !SL', line.length, line.body, argument(v,1), argument(v,2), argument(v,3), argument(v,4));
   if not(odd(stat)) then begin writeln(stat); halt; end;
   writeln(line);
   stat := $fao('!SL !SL', line.length, line.body, argument(v,3), argument(v,4));
   if not(odd(stat)) then begin writeln(stat); halt; end;
   writeln(line);
end;

begin
   test(1, 2, 3, 4);
end.
