You create class cPerson, like bellow
'Class module
Sub Class_Globals
Private mFirstName As String
Private mLastName As String
Private mPhoneNumber As String
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
End Sub
Sub putFirstName(fName As String)As cPerson
mFirstName = fName
Return Me
End Sub
Sub putLastName(sName As String)As cPerson
mLastName = sName
Return Me
End Sub
Sub putPhoneNumber(phoneN As String)As cPerson
mPhoneNumber = phoneN
Return Me
End Sub
Sub PrintPersonToTheLog
Log($"First Name ${mFirstName}
Surname : ${mLastName}
Phone Number : ${mPhoneNumber}"$)
End Sub
And then, when you need it, call it like I posted on the top.
For Example , in the Activity_Create Sub:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Dim Person As cPerson
Person.Initialize
Person.putFirstName("James").putLastName("Bond").putPhoneNumber("007 007-007").PrintPersonToTheLog
End Sub
Log Output:
** Activity (main) Create, isFirst = true **
First Name James
Surname : Bond
Phone Number : 007 007-007
** Activity (main) Resume **