Hello there,
The code I'm using is:
In this way I can control the real state of a class. Othewise, the class will return ever true.
For me It's working perfectly.
But, I'd like to know if it could be a problem.
Erel?
Thanks
The code I'm using is:
B4X:
'Class module
Private Sub Class_Globals
'this override the original Class method isInitialized()
Private IsInitialized As Boolean = False
End Sub
'Property
Public Sub getinitialized As Boolean
Return IsInitialized
End Sub
'Initializes the object
Public Sub Initialize
Try
'// Do Some Code Here
IsInitialized = True
Catch
ToastMessageShow(" Class1: Can't Initialize", True)
End Try
End Sub
B4X:
'Main module
sub SomeSub
dim myClass As Class1
log(myClass.initialized)
myClass.Initialize
log(myClass.initialized)
end sub
In this way I can control the real state of a class. Othewise, the class will return ever true.
For me It's working perfectly.
But, I'd like to know if it could be a problem.
Erel?
Thanks
Last edited: