Program Sread;

{ Part of String Package }

{ Version: 3.2
  File:[22,310]SREAD.PAS
  Author: Jim Bostwick 30-Aug-83

  Last Edit:  23-JUN-1988 22:29:07 

  History: 
	 23-JUN-1988 21:59:08  - JMB PA3UTL upgrade.
  	 12-Mar-84 JMB -- fix type-1 initialization bug
  	 29-Nov-83 JMB -- convert back to null fill
	 21-Nov-83 JMB -- convert to blank fill

  	*** NOTE ***
 This module is in part copyrighted by OMSI. Source distribution 
to lisenced OMSI Pascal sites only.
}
{$NOMAIN}
{[A+,B+,L-,K+,R+] Pasmat Directive }


procedure Sread(var f: text; { an input file }
                var s: packed array [slow..shigh: integer] of char
  	);External;

{*USER*
 Read from specified file into string. Read proceeds until EOLN, or 
the string is filled. Always a trailing Readln. If string is Type "1",
it is filled with trailing Nulls. 
} 

Procedure SRead;
  var
    slen,i: integer;


  begin {SRead}
    if slow = 0 then slen := 0 else  slen := slow-1;
    while (not eoln(f)) and (slen < shigh) do
      begin
      slen := slen + 1;
      read(f, s[slen]);
      end;
    If slow = 0 then s[0] := chr(slen)
    else for i := slen+1 to shigh do s[i] := chr(0);
    readln(f);
  end {SRead} ;

