compiler limit exceeded while assembling user class; 255 fields allowed connect iq 258 used

Hi

SDK 3.1.4 on windows 10

I have a watch face program with this message when i compile the WF.

What is 255 fields   in my program

strings ? settings ? Property ? , variables in program

I understand the problem but i don't know where i must work to fix the problem

Where i can count this counter for other program whitch work correctly actually

Thanks for your help

Didier

Top Replies

  • I have numerous metrics where users should be able to choose from, but each metric requires a string.

    I have a similar problem for my datafields which support 100+ metrics (if you count modifiers…

  • Cutting back the number of stings by 3 to get back to 255 is the quickest solution right now.

    You realize that the original question about 258 strings is from 4 years ago (you responded to…

All Replies

  • native 255 string is necessary only for linking by system  e.g. properties, no way to escape if "something system" need it

    but if you use string internal by loading in code you have try 2 ways:

    1. "multi string"

    <string id="internalstrings">str1;str2;str3;</string>

    and "explode it" and of course you can't use separator in string

    2. put string into json resource but it is from 2.3 CIQ

  • Or hard code the string in your mc file.

  • but than difficult to autotranslate

  • hi, I'm quite interested in this, how do you do this, I mean the 1., do you have an exemple?

  • Example

    6 strings 

    <string id="AllLIB">Trial Ver|TRIAL Version|for PREMIUM Version|Your Ref is |Turn the wrist|bit.ly/.../string>

    28  numbers

    <string id="XYZ1Z8">110|18|110|39|60|175|110|175|162|175|110|195|66|69|66|150|   110|143|110|111|111|152|54|54|54|111|100|100|</string>

    Separator is | 

    In code

    example with strings   parm=0

    ArrayAllLIB =  $.CLASSFUNCTION.split(WatchUi.loadResource(Rez.Strings.AllLIB), "|",6,0);
    example with a number   parm=0
    ArrayOfXYZ1Z8=  $.CLASSFUNCTION.split(WatchUi.loadResource(Rez.Strings.XYZ1Z8), "|",28,1);
     
    After in code you can
    dc.drawtext( ArrayOfXYZ1Z8[0],ArrayOfXYZ1Z8[1],3, ArrayAllLIB[0], CENTER)
    Function split
      function split(s, sep,long,type) {
        var tokens = new [long];

        var found = s.find(sep);
        var i=0;
        var token="";
        while (found != null) {
              token = s.substring(0, found);
              if (type==0) {   tokens[i]=token;}
              else {   tokens[i]=token.toNumber();}
           // System.println(i+" "+token);
            i +=1;
            s = s.substring(found + sep.length(), s.length());

            found = s.find(sep);
        }
     

        return tokens;
    }
  • Many thanks for this! I though he was talking about string ressources for settings.

  • for settings too, for example gps location 0.0;0.0;

    you can read string from settings and explode it to lat/lon

  • I bumped into this error also: I use too much strings for all the settings that my Datarun ultimate datafeikd had. I have numerous metrics where users should be able to choose from, but each metric requires a string.

    Is there a workaround, like putting some things in a barrel?

  • I have numerous metrics where users should be able to choose from, but each metric requires a string.

    I have a similar problem for my datafields which support 100+ metrics (if you count modifiers like "lap" or "max"), but where I don't want to have dropdowns with 100+ entries (simply because I don't think it's the best UX - I never even tried to have ~255 strings in any project.)

    This may not apply to you, depending on what your available metrics look like, but I split each metric into three somewhat logical pieces:

    • Lap modifier: "--" (Session), "Lap", "Last Lap"
    • Other modifier: "--" (Current), "Average", "Min", "Max"
    • Base metric type: "Time", "Distance", "Cadence", "HR", "Speed", ...

    So in this way, I can offer 100+ combinations of metrics, specified in somewhat natural language, by asking the user to select a metric using 3 dropdowns.

    e.g. Cadence => "--", "--", "Cadence

    Last Lap (Average) Cadence => "Last Lap", "--", "Cadence"

    The downsides are it's not intuitive, some of them are redundant (e.g. "Lap -- Cadence" is the same as "Lap Average Cadence"), and some of them don't make sense (e.g. "Lap Average Time", "Lap Min Time").

    Of course, this won't help if you actually have 100+ "base metric types".

    It would've been great if:

    - Connect IQ supported more string resources

    - These string resources didn't impact the runtime memory usage of your app

    - The app settings supported dropdowns with autocomplete / search

  • It would've been great if:

    - Connect IQ supported more string resources

    It would've been great if:

      - you could create settings without string resources and use hard coded strings instead....