function args = getrargof(string,line)
%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.                                                                      

firstbracket = findstr(line,string)+length(string);
if strcmp(line(firstbracket),'(')
	restline = line(firstbracket+1:end);
	secondbracket = firstbracket + findstr(restline,')');
	argstring = line(firstbracket+1:secondbracket-1);
	kommata = findstr(argstring,',');
	nrofargs = length(kommata)+1;
	args = cell(1);
	if nrofargs ==1
        args{1}= argstring;
	else
        args{1}= argstring(1:kommata(1)-1);
		for t=2:nrofargs-1
            args{t}=argstring(kommata(t-1)+1:kommata(t)-1);
        end
        args{nrofargs}=argstring(kommata(nrofargs-1)+1:end);
	end
else
	argstring = line(firstbracket:end);
    firstbreak =min( [findstr(argstring,' '),findstr(argstring,';'),findstr(argstring,'*'),findstr(argstring,'+'),findstr(argstring,'-'),findstr(argstring,'.'),...
            findstr(argstring,'/'),findstr(argstring,'\')])-1;
    if isempty(firstbreak)
        firstbreak = length(argstring);
    end
    args{1}=argstring(1:firstbreak);
end
    
return