Changeset 1186 for cpp/frams/param


Ignore:
Timestamp:
11/20/22 20:32:43 (17 months ago)
Author:
Maciej Komosinski
Message:

For consistency with other numerical types, unlimited string length is now indicated by "-1" as the second value of the definition of the "s" property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/param/param.cpp

    r1184 r1186  
    909909                //if (have == 1) return false; //not sure?
    910910                if ((have >= 1) && (!((a == 0) || (a == 1)))) return false; // 'min' for string (single/multi) can be only 0 or 1
    911                 if ((have >= 2) && (b < 0)) return false; // max=0 means unlimited, max<0 is not allowed
     911                if ((have >= 2) && (b < -1)) return false; // max=-1 means unlimited, >=0 is max len, max<-1 is not allowed
    912912        }
    913913        break;
     
    11621162        if (sscanf(t, "%d %d", &mn, &mx) == 2) //using getMinMax would also get default value, which is not needed here
    11631163        {
    1164                 if ((x.length() > mx) && (mx > 0))
     1164                if ((x.length() > mx) && (mx >= 0))
    11651165                {
    11661166                        vs = x.substr(0, mx);
Note: See TracChangeset for help on using the changeset viewer.