title: Non-const function _fastcall TStrings::GetCount() called for const object
body: <p>I have a old c++ code, wirited and compiled into c++ builder 5. 
  But now, I need to update/migrate this code to c++ builder 2009. So, I have some problems:</p>
  
  <pre><code>int __fastcall TAllConversor::ListToStr(
      const TStringList* pList,
      AnsiString&amp; strValue,
      const long lngLimiteInferior,
      const long lngLimiteSuperior) const
  {
    long lngIndice;
    AnsiString strAux;
  
    try
    {
      if (lngLimiteSuperior == 0)
        lngIndice = pList-&gt;Count;
      else
        lngIndice = lngLimiteSuperior + lngLimiteInferior;
  
      for (int i = lngLimiteInferior; i &lt; lngIndice; i++)
      {
        strAux += pList-&gt;Strings[i] + ";";
      }
  
      strValue = strAux;
      return 1;
    }
    catch(...)
    {
      return 0;
    }
  }
  </code></pre>
  
  <p>At line "lngIndice = pList->Count;" I get this error: "E2522 Non-const function _fastcall TStrings::GetCount() called for const object".</p>
  
  <p>So, how can I solve (work around) it?</p>