Artifact 5e4771d23885e2c49bc698206c3023a4519198b770d046e40c718cbd5b8e87ba:


function args_out = subs_arg(args,Args)
% subs_arg - substitutes arguments into args from Args
% FS defaults to `;'.
% 
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%     %%%%% Model Transformation Tools %%%%%
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% Matlab function  subs_arg.m
% args = subs_arg(args,Args)
% Copyright (c) P.J. Gawthrop, 1996.


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Symbolic argument sign
S = '$';


args_out = '';
if strcmp(args,'')==0
  L = length(args);
  args_count = 1;
  num_count=0;
  while args_count <= L
    ch = str2ch(args,args_count);
    if ch~=S % copy character
      args_out = [args_out, ch];
      args_count = args_count+1;
    else % find argument number
      args_count = args_count+1;
      ch = str2ch(args,args_count);    
      i=0;
      while (ch>='0') & (ch<='9')
	i = 10*i + abs(ch)-abs('0');
	if args_count==L
	  args_count = args_count+1;
	  break
	end;
	args_count = args_count+1;
	ch = str2ch(args,args_count);
      end;
      args_out = [args_out, args2arg(Args,i)];
    end;
  end;
end;

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]