Revision [12471]
This is an old revision of KeyPgVisPublic made by JeffMarshall on 2008-01-18 14:28:07.
PUBLIC: (Access Control)
Specifies public member access control in a KeyPgType Type or KeyPgClass Class
Syntax:
Parameters:
typename
member declarations
member declarations
declarations for fields, functions, or enumerations
Description:
Public: indicates that member declarations following it have public access. Public members are accessible with any usage of the KeyPgType Type or KeyPgClass Class.
member declarations following Public: are public until a different access control specifier is given, like KeyPgVisPrivate Private: or KeyPgVisProtected Protected:
member declarations following Public: are public until a different access control specifier is given, like KeyPgVisPrivate Private: or KeyPgVisProtected Protected:
Members in a KeyPgType Type declaration are Public: by default if no member access control specifier is given.
Examples:
Type testing
Private:
nome As String
Public:
number As Integer
Declare Sub setNome( ByRef newnome As String )
End Type
Sub testing.setnome( ByRef newnome As String )
This.nome = newnome
End Sub
Dim As testing myVariable
'' We can access these members anywhere since
'' they're public
myVariable.number = 69 ''
myVariable.setNome( "FreeBASIC" )
Private:
nome As String
Public:
number As Integer
Declare Sub setNome( ByRef newnome As String )
End Type
Sub testing.setnome( ByRef newnome As String )
This.nome = newnome
End Sub
Dim As testing myVariable
'' We can access these members anywhere since
'' they're public
myVariable.number = 69 ''
myVariable.setNome( "FreeBASIC" )
Dialect Differences:
- Available only in the CompilerOptlang -lang fb dialect.
Differences from QB:
- New to FreeBASIC
See also:
- KeyPgClass Class
- KeyPgVisPrivate Private: (Access Control)
- KeyPgVisProtected Protected: (Access Control)
- KeyPgPublic Public
- KeyPgType Type
Back to User Defined Types