PRIVATE
- Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgPrivate
- Last revised: 2018-05-30
Specifies a procedure having internal linkage
Syntax
vb
Private Sub procedure_name [Cdecl|Stdcall|Pascal] [Overload] [Alias "external_name"] [([parameter_list])] [Constructor [priority]] [Static] [Export]
..procedure body..
End Sub
Private Function procedure_name [Cdecl|Stdcall|Pascal] [Overload] [Alias "external_name"] [([parameter_list])] [ byref ] as return_type [Static] [Export]
..procedure body..
End FunctionDescription
In procedure definitions (forbidden at declaration line level), Private specifies that a procedure has internal linkage, meaning its name is not visible to external modules.
Therefore among the compiled modules, two procedures with the same identifier, but defined inside different modules, may exist if both are Private.
The compiler removes the Private procedures that are not called, but this does not currently work for Private procedures that are only called by other Private procedures that are not called themselves, because the first one appears as being called.
The Option Private statement allows procedures to be defined with internal linkage by default.
Examples
start GeSHi
vb
'e.g.
Private Sub i_am_private
End Sub
Sub i_am_public
End Subend GeSHi
Differences from QB
- New to FreeBASIC
See also
Private:(Access Control)PublicOption PrivateSubFunction
Back to DocToc