Ignore:
Timestamp:
Nov 26, 2010, 5:44:41 AM (13 years ago)
Author:
sommeria
Message:

bug repair for name generation in case of constant name (no indexing)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/name2display.m

    r122 r138  
    7474%case of a numerical index follewed by a lower case letter (e.g. a,b,c):
    7575%the penultimate character is a number and the last one a letter (lower case: last >= 97 && last <= 122
    76 %                                                                 capital letter:  last >= 65 && last <= 90)                                                             
    77 elseif  penult >= 48 && penult <= 57 && (last >= 65 && last <= 90)||(last >= 97 && last <= 122)
     76%                                                                 capital
     77%                                                                 letter:  last >= 65 && last <= 90) 
     78elseif  penult >= 48 && penult <= 57 && ((last >= 65 && last <= 90)||(last >= 97 && last <= 122))
    7879    str_a=last_str; %extract appendix a,b,c... or A,B,C... as output.
    7980    ind_end=indcur-1; %current index just before the suffix letter
     
    129130elseif strcmp(filelit(end),'_')
    130131    indcur=separ3-1;
    131 %     field_count=num3;
    132132    str2='';
    133133    str_a='';
    134134    %detect zeros before the number
    135 %     count=0; % extract the numerical appendix
    136135    field_count=RootFile(separ3+1:end);% set the selected field number'%03d'
    137136    charstring=['%0' num2str(length(field_count)) 'd'];
    138137    nom_type=['_' num2str(1,charstring)];
    139 %     if strcmp('0',RootFile(separ3+1)); % select the non-numerical characters
    140 %         nom_type=['_%0' num2str(length(RootFile(separ3+1:end))) 'd'];
    141 %     else
    142 %         nom_type='_i';
    143 %     end 
    144      
    145138elseif RootFile(indcur-2)=='_'% search appendix a,b,c,d
    146     last=RootFile(indcur-1:indcur);
    147     if isequal(length(last),2)
    148           str_a=last(1);%put appendix a,b,c, ou d
    149           str_b=last(2);%put appendix a,b,c, ou d
    150 %           indcur=indcur-3;
    151           separ0=indsel(end-3);
     139    lasts=RootFile(indcur-1:indcur);
     140%     if isequal(length(last),2)
     141        str_a=lasts(1);%put appendix a,b,c, ou d
     142        str_b=lasts(2);%put appendix a,b,c, ou d
     143        separ0=indsel(end-3);
    152144        field_count=RootFile(separ0+1:separ1-1);
    153145        indcur=separ0;
    154         if double(last) >= 97 & double(last)<= 122
     146        if double(lasts) >= 97 & double(lasts)<= 122
    155147            nom_type='_ab';
    156148            testsub=1;
    157         elseif double(last) >= 65 & double(last) <= 90
     149        elseif double(lasts) >= 65 & double(lasts) <= 90
    158150            nom_type='_AB';
    159151            testsub=1;
     
    161153        charstring=['%0' num2str(length(field_count)) 'd'];
    162154        nom_type=[num2str(1,charstring) nom_type];
    163     end
     155%     end
    164156%search for other names with counter
    165157else
     
    178170                charstring=['%0' num2str(length(field_count)) 'd'];
    179171                nom_type=num2str(1,charstring);
    180 %                 if isequal(field_count(1),'0')
    181 %                     nbfigures=length(field_count);
    182 %                     nom_type=['%0' num2str(nbfigures) 'd'];
    183 %                 else
    184 %                     nom_type='#';
    185 %                 end
    186172            end
    187173    end
Note: See TracChangeset for help on using the changeset viewer.