Private and Public are working bit different as in .net
You will use it within type/end type to grant local or global access to the properties or methods of a type but not write it in front of everything but acting as a switch.
Its like
Type tExample
'Public '(default setting / not needed here)
X As Double
Y As Double
Z as Double
Private ' <<< all that follows until "Public" or "End Type" is from now private
A As Long
B As Long
Function DoSomethingPrivate()
End Function
Public ' <<< switch to end private scope
Function DoSomethingPublic(ByRef lA As Long, ByRef lB as Long )
' here accessing Me.A or Me.B is possible
Me.A= lB - lA
Me.B = lB + lA
since keyword "Me" signals a reference of tExample is accessing
' its own data only while
lA = Me.A
lB = Me.B
' were an illegal exploit since that would not obey the rules of privacy
' because its not only giving direct access to the variables but also
' tells theirs position in memory. Would lead to runtime error
end function
end type
Private
' can not be private outside of type declarations
Am not sure if completely developed yet but if your code follows the rules
it will be compatible
Bookmarks