Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-11 - 43,50531/getvar.pas
There are 2 other files named getvar.pas in the archive. Click here to see a list.
{$m-,c-,d-}
{This implements GETVAR as it existed in the old Pascal, for those
 who have programs that depend upon it.  It uses a variable record
 format where each record starts with an extra word containing a
 count of the number of words following.}

program getvar;
type varrec=record
	recsize:integer;
	data:array[1:100000]of integer;
	end;
     varfile=file of varrec;

{PUTVAR(f,len) is a logical PUT for file F, where LEN words of the
 data area are used.}

procedure putvar(var f:varfile;len:integer);
  begin
  f^.recsize := len;
  put(f:len)
  end;

{GETVAR(f) is a logical GET for file F.  It gets the count, and then
 reads the rest of the record as appropriate.}

procedure getvar(var f:varfile);
  begin
  get(f:0);
  getx(f:f^.recsize)
  end.