B4J Question set and get not being treated as properties

Cableguy

Expert
Licensed User
Longtime User
Hi guys... this is puzzling me...

I have made several customs views in the past, but almost exclusively in B4A, and very very few in B4J, that I never compiled into lib and used them as additional modules...

So now I am trying for the first time to compile a module into a lib and i am facing an issue I can't understand, for it is one of the most trivial things ever...

B4X:
public Sub setImage(dir As String, filename As String)
    mPhoto.SetImage(fx.LoadImage(dir,filename))
End Sub
Public Sub getImage As Image
    Return mPhoto.GetImage
End Sub

Untitled1.png
 

klaus

Expert
Licensed User
Longtime User
Public Sub setImage(dir As String, filename As String)
This will not work as a property, because you have more than one parameter!
setSomething(Value As Int) works as a property only with ONE parameter.
You need to use it as a method:
Public Sub SetImage(dir As String, filename As String)
As SetImage is not considered as a Property, getImage is not considered as a Property either.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Thank you Klaus, for clearly explaining this... I was going craaaazy!
 
Upvote 0
Top