开发者

Lazarus error - how to store result of integer in textbox?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜