if (comp)
if (allowComp && comp)
    public int getStringLength(String str, boolean comp)    {        // This is similar to DeparseString (below);        // but this function does not deparse the string, it just counts        // the number of characters.        // Naturally, the value returned represents the string's un-        // compressed length.        // (xlen is the length of the code-formatted string)        // (Returns -1 if a bracket error is encountered)        if (comp)            str = compressString(str);        int len = 0;        int bracketlevel = 0;        int ch;        int xlen = str.length();        for (int i = 0; i < xlen; i++)        {            //            if(str.charAt(i) == '\0')            //            {            //                CString x;            //                x.Format("%d", i);            //                AfxMessageBox(x);            //                break;            //            }            if (str.charAt(i) == '[')            {                bracketlevel++;                continue;            }            if (str.charAt(i) == ']')            {                bracketlevel--;                continue;            }            if (bracketlevel < 0)            {                return -1;            }            if (bracketlevel > 0)            {                int j = 0;                do                {                    try                    {                        ch = str.charAt(i++);                    }                    catch (StringIndexOutOfBoundsException se)                    {                        //return -1 on an error                        return -1;                    }                    if (ch == ']')                    {                        len++;                        j = 0;                        i -= 2;                        break;                    }                    if (ch == ' ' || ch == ']')                    {                        if (j != 0)                        {                            len++;                            j = 0;                        }                    }                    else                        j++;                    if (j == 32)                        break;                }                while (ch != ']');            }            else            {                len++;            }        }        if (bracketlevel != 0)        {            return -1;        }        return len;    }