V vinnythepooh71 Member Licensed User Longtime User Nov 8, 2014 #1 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
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 Nov 8, 2014 #3 vinnythepooh71 said: 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 Click to expand... You could also use GetDefault: Upvote 0
vinnythepooh71 said: 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 Click to expand... You could also use GetDefault:
V vinnythepooh71 Member Licensed User Longtime User Nov 8, 2014 #4 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
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 ?
V vinnythepooh71 Member Licensed User Longtime User Nov 8, 2014 #6 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
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
LucaMs Expert Licensed User Longtime User Nov 8, 2014 #7 vinnythepooh71 said: if "Ciccio" is not in the map Click to expand... If Clients.ContainsKey("Ciccio") then Upvote 0
vinnythepooh71 said: if "Ciccio" is not in the map Click to expand... If Clients.ContainsKey("Ciccio") then
V vinnythepooh71 Member Licensed User Longtime User Nov 8, 2014 #8 Thanks Luca , it works, are you italian as well ? Upvote 0