Hi,
I'm not quite sure how initialization works.
I often use a method that returns some object. Under some conditions such a method could just return null
I sometimes encounter problems if checking the return of this method by means of:
I then check on "IsInitialized" but I can't seem to understand what "initialization" does. Some kind of construction, but still ...
Also: if I create a custom class can I cann my "initialization" method any name ?
Tx
I'm not quite sure how initialization works.
I often use a method that returns some object. Under some conditions such a method could just return null
B4X:
Sub SomeMethod as SomeObject
if (some condition) then
Dim obj as SomeObject
obj.initialize
return obj
else
return null
end if
end sub
I sometimes encounter problems if checking the return of this method by means of:
B4X:
if SomeMethod = Null then ...
I then check on "IsInitialized" but I can't seem to understand what "initialization" does. Some kind of construction, but still ...
Also: if I create a custom class can I cann my "initialization" method any name ?
Tx