Map.mod

BlitzMax Forums/BlitzMax Programming/Map.mod

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.

Lots of things, but most commonly you set the Key to be a String and point the Value at some object. Then you've got something that resembles an array that uses a String as the element index instead of an integer. Like associative arrays in PHP or Lua.

You could use it like this:
Local m:TMap = New TMap

m.Insert("img1.jpg",LoadImage("img1.jpg"))
m.Insert("img2.jpg",LoadImage("img2.jpg"))

DrawImage(TImage(m.ValueForKey("img1.jpg")), 100, 100)

Not sure why you would want to do that, but you can :)