Reputation: 49
I have the following code in a form:
procedure TForm1.RoundClick(Sender: TObject);
var
Number : real;
begin
rNumber := Number.Value;
ShowMessage('Round(rNumber) = '+FloatToStr(Round(rNumber)));
end;
This results in the following compiler error:
[Error] Unit1.pas(39): Missing operator or semicolon
I don't see any missing semicolons and I don't know where to put an operator, the error is at my rNumber
.
Upvotes: 0
Views: 354
Reputation: 612954
The problem is that your class has a button whose name is Round
. So when you write Round(...)
, the compiler sees Round
as a button rather than a function.
You can do either of the following:
System.Round
because the Round
function is defined in the System
unit.Upvotes: 4