I have started wrapping a java library to ease my use of it with B4J (I was using it with JavaObject). I stumbled upon something that I don't get and I can replicate with the ResultSet object.
I have the same stiution with a class in the library I wrapped. Why isn't "rs" passed as reference ?
B4X:
'code module Module1
Sub Process_Globals
Public rs As ResultSet
End Sub
Sub AppStart(Args() As String)
Log(rs.IsInitialized) 'rs not initialized
InitRSInSub(rs)
Log(rs.IsInitialized) 'rs not initialized
End Sub
Private Sub InitRSInSub(MyRS As ResultSet)
Dim SQLObject As SQL
SQLObject.Initialize2(......) 'initialize a connection to the database
Dim query As String = ..... 'create a query
MyRS = SQLObject.ExecQuery(query)
Log(MyRS.IsInitialized) 'myrs is initialized but just in the sub's scope
End Sub
I have the same stiution with a class in the library I wrapped. Why isn't "rs" passed as reference ?