Difference between revisions of "Public"

From Lazarus wiki
Jump to navigationJump to search
(English translation of German page)
 
Line 11: Line 11:
 
* makes sense if the subroutine is not used outside the unit.
 
* makes sense if the subroutine is not used outside the unit.
  
As long as the subroutine has not been declared in the interface section of the unit, it is not visible to other units.
+
As long as the subroutine has not been declared in the interface section of the unit, it is not visible to other units.<br>
 +
However, it will be possible to access the function subTest at the assembly-language level, by using its mangled name.
  
 
<syntaxhighlight lang=pascal>
 
<syntaxhighlight lang=pascal>

Revision as of 17:23, 23 February 2020

Deutsch (de) English (en)


Back to Reserved words.


The modifier public:

  • is part of the programming of subroutines;
  • makes a subroutine public within the unit;
  • makes sense if the subroutine is not used outside the unit.

As long as the subroutine has not been declared in the interface section of the unit, it is not visible to other units.
However, it will be possible to access the function subTest at the assembly-language level, by using its mangled name.

function subTest : string; [Public];
  begin
    subTest := 'abc';
  end;