I'm trying out a very simple program in LAZARUS to multiply two text box val开发者_运维知识库ues and store the result in a third one. This line is what I'm using.
txtA.Text = IntToStr( StrToInt(txtA.Text ) + StrToInt(txtB.Text) );
Unfortunately I get an error stating it's illegal.
Is this a fault on my part or a bug in Pascal?
Thanks for any tips!
The assigments in Pascal uses :=
try this
txtA.Text := IntToStr( StrToInt(txtA.Text ) + StrToInt(txtB.Text) );
I also tend to use IntToStr() also, but you also have the option of using format() - which is preferred for strings that might be translated.
精彩评论