TStringList Question lazarus / 62-General ---------------------------------------------------------------------- nugax · 2022-04-18 03:24 I am trying to determine if a character in a TStringList Array Line is a '-' or char 45. It is loaded properly but errors out here. Should this work, or is there some other way? It disconnects (errors) at the statement:  if (MsgList[iPrintCnt].Chars[0] = '-') Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i while (iPrintCnt < 14) Do  begin    if (MsgList.Count  >= (iPrintCnt + 1)) Then    begin     write('here');      if (MsgList[iPrintCnt].Chars[0] = '-') then      begin       write('here2');       if (MsgList[iPrintCnt].Chars[2] = '-') then       begin        write('here3');          cyberio.PipeWriteString('|15' + MsgList[iPrintCnt] + #13#10);          Inc(iPrintCnt);          cyberio.PipeWriteString('|11' + MsgList[iPrintCnt]);       end;      end      else      begin          cyberio.PipeWriteString('|10' + MsgList[iPrintCnt] + #13#10);      end;     end;      {    while(iCharCnt < MsgList[iPrintCnt].Length) Do    //Write CRLF if CR Found    write('here');      begin      if (MsgList[iPrintCnt].Chars[iCharCnt] = #13) Then      begin           cyberio.PipeWriteString(#13#10);      end       //Check For FTN And Origin Line To Color Properly      else if (MsgList[iPrintCnt].Chars[iCharCnt] = #45) then      begin        if (MsgList[iPrintCnt].Chars[iCharCnt + 1] = #45) then        begin        if (MsgList[iPrintCnt].Chars[iCharCnt + 2] = #45) then          begin             cyberio.PipeWriteString(ansi.BrightWhite);           cyberio.PipeWriteString(MsgList[iPrintCnt].Chars[iCharCnt]);           cyberio.PipeWriteString(MsgList[iPrintCnt].Chars[iCharCnt + 1]);           cyberio.PipeWriteString(MsgList[iPrintCnt].Chars[iCharCnt + 2]);             boolFoundTearLine := True;          end;        end;      end       else      begin         cyberio.PipeWriteString(MsgList[iPrintCnt].Chars[iCharCnt]);      end;       Inc(iCharCnt);    end;    }    Inc(iPrintCnt);  end; ---------------------------------------------------------------------- nugax · 2022-04-18 03:34 I was able to resolve this by simply using substring. Thanks