iOS Question Get the Long type using GetType

DIEGO TREJO

Member
Licensed User
[SOLVED] In B4i, the GetType function always returns __NSCFNumber regardless of whether the data is Int, Byte, Float, Decimal or Long. Is there a way to differentiate these types of data? I am interested in differentiating the Long type
 
Last edited:

DIEGO TREJO

Member
Licensed User
From nowhere in particular. I just need to differentiate the Long type from the other numerical types, since it is used to store DateTime
 

Erel

Administrator
Staff member
Licensed User
There isn't enough information here but you should probably store a custom type instead of just the number. This can be done with KVS2 or B4XSerializator.
 

Semen Matusovskiy

Well-Known Member
Licensed User
I use Is statement. For example, if x is an object:
B4X:
    If x Is Int Then ...
    If x Is Long Then ...
    If x Is Float Then ...
    If x Is Double Then ...
 
Top