I am attempting to unify some routines in this class.
I could, for example, test the type of value passed as a parameter instead of choose to use GetObject or GetSimple.
The first thing I did was look at what GetType returns:
Code:
Public Sub TestType(Value As Object)
Log(Value & " - " & GetType(Value))
End Sub
Code:
Dim TestString As String = "TestString"
Dim TestInt As Int = 1
Dim TestFloat As Float = 1.5
Dim TestArrInt(1) As Int
TestArrInt(0) = 2
kvs.TestType(TestString)
kvs.TestType(TestInt)
kvs.TestType(TestFloat)
kvs.TestType(TestArrInt)
The result of these tests:
TestString - java.lang.String
1 - java.lang.Integer
1.5 - java.lang.Float
[I@417ef0a8 - [I
It would be useful something like: IsArray (and maybe IsMap, etc.).
This is already part of B4A?
At this time I remember that I read something about the square brackets.
[I means array of Int and probably [S array of String,
but I struggled to write the question, then I public anyway the post
I'll have to re-read the basic manual
[UPDATED]
Surely I have read somewhere an explanation about arrays, with square brackets and the distinction between upper and lower case ([I [i [B ...) and did not relate B4A, since it is not in the basic pdf of this language.
Where I've read all this ... I do not remember.
If anyone knows anything ... thanks in advance