'Class module
Sub Class_Globals
Private FirstName, LastName As String
Private Age As int
End Sub
Public Sub Initialize ...
End Sub
------
class module 2 (people.bas):
'Class module
Sub Class_Globals
Private MAXPEOPLE As Int: MAXPEOPLE = 100
Private People(MAXPEOPLE) As Person ' array of person classes
End Sub
Public Sub Initialize (...)
End Sub
'In module 2 I cannot reference individual fields of the Person class from the 'array because they are defined as "private".
'if I try to reference the 'name field from the first entry in the array as follows it cannot be accessed:
Public Sub GetFirstName (idx AS Int) As String
return People(idx).FirstName
EndSub
'however,
'if I declare the Person Class in the following manner all works fine:
class module 1(person.bas):
'Class module
Sub Class_Globals
Dim FirstName, LastName As String
Dim Age As int
End Sub
Public Sub Initialize ...
End Sub