Returning Types from TMap

BlitzMax Forums/BlitzMax Beginners Area/Returning Types from TMap

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ok, I have a TMap with custom types in it

I want to return a type instance from the map, using ValueForKey and then run a method in the returned instance

If I simply return the instance to a variable, it complains that the method doesnt exist and wont compile the program

If I declair the variable to be of the same custom type, it complains that it cant convert from Object to the custom type

The only way around this I can think of is to somehow get ValueForKey to return the instance as its type, instead of as an object

However I've been unable to find a way to do this