From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 27-JUL-1990 13:29:22.43
To:	MRGATE::"ARISIA::EVERHART"
CC:	
Subj:	SHOW/REMOTE 4

Received:  by crdgw1.ge.com (5.57/GE 1.70)
	 id AA06438; Fri, 27 Jul 90 13:10:09 EDT
Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Fri, 27 JUL 90 09:40:21 PDT
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA07298; Fri, 27 Jul 90 09:24:14 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 27 Jul 90 16:08:34 GMT
From: umich!vela!tarcea@CS.YALE.EDU  (The OUTLAWS)
Organization: Oakland University, Rochester MI
Subject: SHOW/REMOTE 4
Message-Id: <2257@vela.acs.oakland.edu>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com



-+-+-+-+-+-+-+-+ START OF PART 4 -+-+-+-+-+-+-+-+
X trim(s);
X to_string:=s;
Xend;
X
X`091global`093
Xfunction after(the_str:string; the_start: integer): string;
Xbegin
X  if the_start> length(the_str) then after:=''
X  else if the_start <1 then after:=the_str
X  else  after:=substr(the_str,the_start,length(the_str)-the_start+1);
Xend;
X
X`091global`093
Xfunction before(the_str: string; the_start: integer): string;
Xbegin
X  if the_start>length(the_str) then before:=the_str
X  else if the_start<1 then before:=''
X  else before:=substr(the_str,1,the_start);
Xend;
X
X`091global`093
Xprocedure fix_name(var name: packed array`091l1..u1:integer`093 of char);
Xvar
X temp,num: string;
X i,n : integer;
Xbegin
X temp:=name;
X trim(temp);
X i:=str$find_first_in_set(temp,'0123456789');
X if i=0 then n:=1
X else`032
X  begin
X   num:=after(temp,i);
X   temp:=before(temp,i-1);
X   n:=to_integer(num);
X   n:=n+1;
X  end;
X num:=to_string(n);
X trim(num);
X if length(temp)<11 then temp:=temp+num
X else if (length(temp)=11) and (n<10) then temp:=temp+num
X else if (length(temp)=11) and (n>9) then temp:=substr(temp,1,10)+num
X else if (length(temp)=12) and (n<10) then temp:=substr(temp,1,11)+num
X else if (length(temp)=12) and (n>9) then temp:=substr(temp,1,10)+num;
X name:=temp;
Xend;
X
X`123`091global`093
Xprocedure remove_illegal(var name:string);
Xvar`032
X i: integer;
Xbegin
X i:=str$find_first_not_in_set(name,LEGAL_CHARS);
X while (i>0) do
X  begin
X   name:=before(name,i-1)+after(name,i+1);
X   i:=str$find_first_not_in_set(name,LEGAL_CHARS);
X  end;
X if length(name)>12 then`032
X  begin
X   name.length:=12;
X  end;
Xend;`125
X
X`123`091global`093
Xfunction parse_full_name(name:string): string;
Xvar
X user_name: string;
X i: integer;
Xbegin
Xi:=index(name,' ');
Xif i=0 then user_name:=name
Xelse`032
X begin
X  user_name:=before(name,i-1);
X  name:=after(name,i+1);
X  trim(name);
X  name:=name+' ';
X  i:=index(name,' ');
X  while (i>1) do
X   begin
X    user_name:=user_name+name`0911`093;
X    name:=after(name,i+1);
X    trim(name);
X    name:=name+' ';
X    i:=index(name,' ');
X   end;
X end;
Xremove_illegal(user_name);
Xparse_full_name:=user_name;
Xend;`125
X
X`091global`093
Xfunction yes(answer: char):boolean ;
X   begin
X     if ((answer='y') or (answer='Y')) then yes:= true
X     else yes:= false ;
X   end ;
X
X`091global`093
Xprocedure to_packed(str: varying`091len`093 of char ;
X                    var out: packed array`091lo..hi: integer`093 of char) ;
X
X   var
X    i: integer ;
X   begin
X     if (length(str) < hi) then begin
X        for i:= 1 to length(str) do out`091i`093:= str`091i`093 ;
X        for i:= length(str)+1 to hi do out`091i`093:= ' ' ;
X      end
X     else for i:= 1 to hi do out`091i`093:= str`091i`093 ;
X   end ;
X
X
X`091global`093
Xprocedure make_string(in_str: packed array `091u1..u2: integer`093 of char ;
V var out_str: string) ;
X   var
X    i: integer ;
X   begin
X     out_str.length:= 0 ;
X     for i:= 1 to u2 do out_str:= out_str+in_str`091i`093 ;
X   end ;
X
X
X`091global`093
Xfunction exists(file_spec: varying`091len1`093 of char): boolean ;
X  var
X    result_spec: varying`091132`093 of char ;
X    context,ret_stat: unsigned ;
X  begin
X    context:= 0 ;
X    ret_stat:= lib$find_file(file_spec,result_spec,context) ;
X    if not odd(ret_stat) then exists:= false
X    else exists:= true ; `123* rms$_fnf *`125
X    lib$find_file_end(context) ;
X  end ;
X
Xend.
$ CALL UNPACK UTIL.PAS;1 507463262
$ v=f$verify(v)
$ EXIT

