(* 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) *)
program strcvt(input,output);

type
   vstring = varying [80] of char;         
   fstring = packed array [1..80] of char; 
             
function v2f(v:vstring):fstring;

begin
   v2f:=v.body;
end;

function f2v(f:fstring):vstring;

var
   tmp : vstring;

begin
   tmp.body:=f;
   tmp.length:=length(f);
   f2v:=tmp;
end;

var
   v1 : varying [60] of char;         
   f1 : packed array [1..60] of char; 
   v2 : varying [100] of char;         
   f2 : packed array [1..100] of char; 

begin
   v1:='This is a test-string';
   f1:='This is a test-string';
   f2:=v2f(v1);
   v2:=f2v(f1);
end.
