TList

BlitzMax Forums/BlitzMax Beginners Area/TList

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.

do you mean arrays?

something like this:
Local pencil_Boxes:Int[10]
pencil_boxes[0] = 4    ' this box has 4 pencils
pencil_boxes[1] = 6    ' and this box has 6 pencils
Print pencil_boxes[0]
Print pencil_boxes[1]



Arrays in BlitzMax are very versatile. (sometimes even moreso than lists) An Array can hold a number (i.e an int, a float, Double, etc) or can hold a String ( "foo" )

you can resize them on the fly by using slices:
Local foo:String[]

foo = foo[..2]		' a slice
foo[0] = "Hello"
foo[1]= "GoodBye"

Print "foo has " +Len(foo)+ " Elements"
Print foo[0] 
Print foo[1]