Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Type Mex(Text As String, Owner As String)
End 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 m As Mex
m.Initialize
m.Owner = "Fred"
m.Text = "Hi"
Log("Mex1: " & m)
Dim rf As RandomAccessFile
rf.Initialize(File.DirInternal, "mex2.dat", False)
rf.WriteB4XObject(m, rf.CurrentPosition)
rf.Close
Dim rf2 As RandomAccessFile
rf2.Initialize(File.DirInternal, "mex2.dat", False)
Dim m2 As Mex = rf2.ReadB4XObject(rf.CurrentPosition)
Log("Mex2: " & m2)
rf2.Close
End Sub