Getting object class type

roiuziel

Member
Licensed User
Longtime User
Is there a way to get the object class type.

Something like instanceof command in Java.

I want to make a function that can support several datatypes and that will check the object original type before deciding what to do with it.

Thanks,
Roi/Dodly
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Another option is to create a method with the same signature in each class and then use CallSub to call this method. This way you do not need to check the exact object type and the object itself is responsible for handling the required task.

This is sometimes referred as duck typing: Duck typing - Wikipedia, the free encyclopedia
 
Upvote 0
Top