1

In delphi what is the status/scope of a method declared before the private/public/protected keywords. see below

type

TMyForm = class(TForm)
Procedure test();
private
...
public
...
protected
...
end;
Tony Wolff
  • 732
  • 1
  • 10
  • 23

1 Answers1

6

Every time you have a question about the Delphi language or RTL, you should consult the official documentation. In this case, the section named Visibility of Class Members on Classes and Objects contains the following information:

Members at the beginning of a class declaration that do not have a specified visibility are by default published, provided the class is compiled in the {$M+} state or is derived from a class compiled in the {$M+} state; otherwise, such members are public.

So, for instance, in a class derived directly from TObject, any such members are public. In a class derived from TPersistent, which includes all components (and therefore all controls), they are published.

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384