Missing operator or semicolon in Delphi 7

857 views Asked by At

I've got the error message "Missing operator or semicolon" on line 38 of this code:

procedure TForm1.SpinEdit1Change(Sender: TObject);
begin
  case SpinEdit1.Value of
    1: Label6.Caption('rok'); // line 38
  end;
end;

end.

Does somebody know what I am missing? Thank you.

1

There are 1 answers

0
David Heffernan On BEST ANSWER
Label6.Caption('rok')

Caption is a property which behaves as a variable does. You treat it as though it is a procedure (which it is not) and hence the compilation error. The parser knows that the only thing that can follow a property name is a semicolon, bracket (if the property is indexed) or an operator like :=, +, = etc.

This code would compile:

Label6.Caption := 'rok';

Perhaps that's what you meant.