private locObj as Object
locObj = Map1.Get("key1")
if locObj is TMyType then
private locMyType as TMyType
locMyType = locObj
else
if locObj is TMyType2 then
private locMyType2 as TMyType2
locMyType2 = locObj
else
'This is not TMyType or TMyType2, so it probably is a String?
private locStr as String
locStr = locObj
end if
end if