There is a function:

int readCoord(String coord) { String pos; String whatFind = coord + "="; int startPos = PosEx(whatFind, XX); int endPos = PosEx(";", XX, startPos); pos = XX.SubString(startPos+2, endPos - startPos-2); int posConverted = StrToInt(pos); return posConverted; ShowMessage(pos); // LOG } 

I use this:

 int posX = readCoord("x"); Label4->Caption = posX; int posY = readCoord("y"); Label5->Caption = posY; int posR = readCoord("R"); Label6->Caption = posR; 

Counts nothing and knocks an error:

'' is not valid integer value

I do not understand where I did something wrong

  • one
    Try using debugger. - Athari
  • one
    Probably falls StrToInt (pos); pos equals empty string
  • And in what line falls? What are the variables with which the code works in this line? - VladD
  • Well, you have a quotation falls into the call atoi() somewhere in the depths of this thing. - igumnov

1 answer 1

  1. What is the ХХ in the implementation of the readCoord() ?

  2. Label5->Caption = IntToStr(posY); // обратите внимание на Label5->Caption = IntToStr(posY); // обратите внимание на IntToStr