Wish Set & Get with parameters

IdasI4A

Member
Licensed User
I would like define properties with parameters (pairs of functions getXXX/setXXX) in a way similar to:
B4X:
public Sub setTextMatrix(Fila as int, Columna as int, Valor As String)
' ....
End Sub

public Sub getTextMatrix(Fila as int, Columna as int) As String
'....
End Sub
B4A already has this feature, but with no parameters.
I'd like to be able to define it and see in the IDE in the same way:
upload_2019-6-25_15-43-3.png

It's usage should be like the following:
B4X:
miTabla.TextMatrix(1,2)="Hello"
' or
S=mitabla.TextMatrix(2,3)
Thank you
 

alwaysbusy

Expert
Licensed User
That is like the weirdest thing I have ever seen. I don't even think the underlying Java is able to do that.
 

Erel

Administrator
Staff member
Licensed User
That is like the weirdest thing I have ever seen. I don't even think the underlying Java is able to do that.
It doesn't really matter whether the underlying Java can do it or not. There are many features in B4X that are not supported by Java (resumable subs, properties and many others).

I'm not sure how many developers will use such a feature however it is similar to C# index properties.
 
Top