Mintoris Forum

Author Topic: Hashtable usage  (Read 1875 times)

userloser

  • Jr. Member
  • **
  • Posts: 4
Hashtable usage
« on: Nov 15, 2014, 05:16 PM »
It seems it isn't possible to use a hashtable in the 'natural' way,
i.e. with the keys working like the array subscripts, like this:

Code: [Select]
ht = CreateHashTable()

ht("name") = name$
ht("id") = id
ht("busy_weekdays") = some_array
ht("friends") = some_hashtable
       
'… later
print ht("name"), "your id is :", ht("id") 'or whatever

Currently, one has to go through syntactic hoops of assignment to
variables, putting those into the struct and later getting the data
out again via assignments to other variables, which gets tedious quickly.

Is there an easier way of using structs that I've missed?

Thanks,