Assoc arrays suported?

BlitzMax Forums/BlitzMax Programming/Assoc arrays suported?

orgos(Posted 2005) [#1]
BMax have some thins like an Associative array?

Myarray["name"] = "john"
Myarray["lastname"] = "fox"

???


kfprimm(Posted 2005) [#2]
u could do something like this.

Const NAME=1
Const LASTNAME=2

Myarray:String[2]

Myarray[NAME]="john"
Myarray[LASTNAME]="fox"`



Robert(Posted 2005) [#3]
Hi Orgos,

I think what you are after is the TMap type. It is not documented, but if you open mod/brl.mod/map.mod/map.bmx you can get an idea of how it works.

It allows you to store key-value pairs which can be searched very quickly.