Android Question Map class

vinnythepooh71

Member
Licensed User
Longtime User
Hello , i have a problem, i need to know if an object returned by a map class is valid , for example :

Dim myClient as Client = Clients,Get("Ciccio")

if "Ciccio" is not in the map, what kind of result do i get ? how can perform an action based on this value ?

i come from c++ and using an stl class that would be trivial , but i couldn't find a good tutorial on the map class
 

LucaMs

Expert
Licensed User
Longtime User
Hello , i have a problem, i need to know if an object returned by a map class is valid , for example :

Dim myClient as Client = Clients,Get("Ciccio")

if "Ciccio" is not in the map, what kind of result do i get ? how can perform an action based on this value ?

i come from c++ and using an stl class that would be trivial , but i couldn't find a good tutorial on the map class

You could also use GetDefault:
upload_2014-11-8_13-53-53.png
 
Upvote 0

vinnythepooh71

Member
Licensed User
Longtime User
the syntax

if myClient!=null then
.
.
end if

doesn't work, the compiler signals me an error , can anyone post me a code fragmetn to see where i am worng in this example ?
 
Upvote 0

vinnythepooh71

Member
Licensed User
Longtime User
The syntax

if ( myClient <> NUll )
..
..
end if

doesn't work, becasue myClient is an invalid reference and cannot be compared
i am trying GetDefault to see if i can manage to get it working
 
Upvote 0
Top