function c=cgrpi(c1)
% function c=cgrpi(c1) adds up to 7 strings to array, interactive version
% An interactive version of cgrp.
% Start with a character matrix, vector or empty c1.
% If there is no argument, c1 is taken to be empty.
% Add as many character vectors to it as you wish.
% Each vector is extended to fit or if a new vector is
%  longer than the rest, they are extended.
% Unfortunately, a reply that starts with a blank will be ignored.
% The reply [] terminates the program.
%Example:>> cgrpi
%         Give the next character vector or [] to quit: a
%         Give the next character vector or [] to quit: 123
%         Give the next character vector or [] to quit: asdf
%         Give the next character vector or [] to quit: []
c = '';
if nargin==1
   c=c1;
end
while 1
   C2=input('Give the next character vector or [] to quit: ','s');
   if length(C2)<2 
      C2=cext(C2,2);
   end
   if C2(1:2)=='[]'
      return
   end
   CR=size(c);
   LC2=length(C2);
   if length(C2)>CR(2)
      C3=c;
      c=[];
      for j=1:CR(1) 
          c=[c;cext(C3(j,:),LC2)];
      end
      c=[c;C2];
    elseif LC2<CR(2)
       c=[c;cext(C2,CR(2))];
    else
      c=[c;C2];
    end
end
