Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Type CustomUserType(Name As String, Ages As Byte, PhoneNumber As String)
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
Dim Wave As WaveFile
Wave.Initialize
Dim I As Int = 12
Dim B As Byte = 28
Dim S As Short = 45
Wave.WriteSample(I)
Wave.WriteSample(B)
Wave.WriteSample(S)
Log(" ")
Dim UserType As CustomUserType
' T.Initialize
UserType.Name = "Name1"
UserType.Ages = 40
UserType.PhoneNumber = "78987897987"
Wave.WriteContact(UserType)
Log(" ")
Dim UserClass As CustomUserClass
UserClass.Initialize("Name2", 50, "4565456544")
UserClass.WriteContact(UserClass) ' A Class pass itself as Object argument with same arguments of costructor
Log(" ")
UserClass.Ages = 60
UserClass.Name = "Name3"
UserClass.PhoneNumber = "5555555555555"
UserClass.WriteContact(UserClass) ' A Class pass itself as Object argument with custom arguments
Log(" ")
Dim Obj1, Obj2 As Object
Dim intArray(1) As Int
intArray(0) = 5
Obj1 = intArray
Dim shortArray(10) As Short
For i = 0 To shortArray.Length-1
shortArray(i) = i * 1000
Next
Obj2 = shortArray
UserClass.MyFunction(Obj1, Obj2, shortArray) ' First and second do not work, third works because we pass an array, no Object
'NOTE: I even tried to pass array not converted to Object, but do not work, so tis way (UserClass.MyFunction(shortArray, shortArray, shortArray)
'so I think Object cannot cast an Array? Right?
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub