Overview
Comment:Uses str2ch to exteact a char from a string.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 84fc025a5b03d24d0ad5dfaf8a465a2a3ffcef5da070daa75b904c9e27302a16
User & Date: gawthrop@users.sourceforge.net on 1996-08-30 09:58:55
Other Links: branch diff | manifest | tags
Context
1996-08-30
10:04:20
Included `;' in demimiter list. check-in: 5e351e113e user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:58:56
Created branch unlabeled-1.2.1 check-in: 52c052eb87 user: gawthrop@users.sourceforge.net tags: origin/unlabeled-1.2.1, trunk
09:58:55
Uses str2ch to exteact a char from a string. check-in: 84fc025a5b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:54:44
Initial revision check-in: a817a166ed user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/args2arg.m from [0679a2d0ae] to [4cfa92ae45].

1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17



18
19
20

21


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function arg = args2arg(args,n)
% args2arg - pulls the nth argument from a comma-separated list.

% 
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%     %%%%% Model Transformation Tools %%%%%
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% Matlab function  args2arg.m
% arg = args2arg(args,n) 
% Copyright (c) P.J. Gawthrop, 1996.


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



% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Field separator

FS = ',';


arg = '';
L = length(args);
args_count = 0;
for i=1:n
  arg_count = 0;
  arg = '';
  if args_count == L
    break;
  end;  
  while args_count < L
    args_count = args_count+1;
    arg_count = arg_count+1;
    ch = args(args_count);
    if ch==FS
      break;
    end;
    arg(arg_count) = ch;
  end;
end;
|
|
>






|








>
>
>



>
|
>
>












|



|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function arg = args2arg(args,n,FS)
% args2arg - pulls the nth argument from a FS-separated list.
% FS defaults to `;'.
% 
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%     %%%%% Model Transformation Tools %%%%%
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% Matlab function  args2arg.m
% arg = args2arg(args,n,FS) 
% Copyright (c) P.J. Gawthrop, 1996.


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.1  1996/08/27  12:50:43  peterg
% %% Initial revision
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Field separator
if nargin<3
  FS = ';';
end;

arg = '';
L = length(args);
args_count = 0;
for i=1:n
  arg_count = 0;
  arg = '';
  if args_count == L
    break;
  end;  
  while args_count < L
    args_count = args_count+1;
    arg_count = arg_count+1;
    ch = str2ch(args,args_count);
    if ch==FS
      break;
    end;
    arg = [arg ch];
  end;
end;


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