Changeset 2394


Ignore:
Timestamp:
10/08/09 09:12:58 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added addfield.m

Location:
issm/trunk/src/m/classes/@pairoptions
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/@pairoptions/changefieldvalue.m

    r2392 r2394  
    44%   Usage:
    55%      pairoptions=changefieldvalue(pairoptions,field,newvalue)
     6%
     7%   the value associated with all the fields equal to the one given in
     8%   input will be modified. If no field is foud, the field will be to
     9%   the option list added
    610
    711%track occurance of field
     
    913
    1014%replace value
    11 for i=1:length(lines),
    12         pairoptions.list{lines(i),2}=newvalue;
     15if isempty(lines),
     16        %add new field if not found
     17        pairoptions=addfield(pairoptions,field,newvalue);
     18else
     19        for i=1:length(lines),
     20                pairoptions.list{lines(i),2}=newvalue;
     21        end
    1322end
Note: See TracChangeset for help on using the changeset viewer.