Dim array manipulation?

Blitz3D Forums/Blitz3D Beginners Area/Dim array manipulation?

Have a look at the Types structure.

Type t_list
field num
field name$
end Type
Global list.t_list

;create some new element
for n = 1 to 10
list.t_list = new t_list
list\num = n
list\name = "something fun_" + n
next


;now scroll the list using the dedicated for .. each loop
for list.t_list = each t_list
print list\n * " = " + list\name
next

;delete an element from the list
for list.t_list = each t_list
if list\name = "something fun_5" then
delete list
exit
endif
next

;count the element of the list
for list.t_list = each t_list
count = count + 1
next
print "the list contains " + count + " elements"

;delete all the element from the list
delete each t_list

Hope this helps,
Sergio.