Arrays?

BlitzMax Forums/BlitzMax Beginners Area/Arrays?

Hotshot2005(Posted 2010) [#1]
If I want to make lists of 4 flims in arrays...do i put this

local Flims[1..4]

or

local Flims[4]?

I am not sure of myself :(


iprice(Posted 2010) [#2]
LOCAL film[4]

However, that would actually hold five numbers, not names -

film[0]=54
film[1]=32
film[2]=23
film[3]=19
film[4]=67

If you want to hold the NAME of a film in an array you must use -

film$[4]

notice the "$"

film$[0]="Star Wars"
film$[1]="E.T."

etc.


Hotshot2005(Posted 2010) [#3]
thank you iprice :)


JBR(Posted 2010) [#4]
I thought [4] only hold 4. i.e. [0],[1],[2],[3]

Jim


Hotshot2005(Posted 2010) [#5]
that correct :)


Czar Flavius(Posted 2010) [#6]
Something to clarify from my post to your other topic, so as to not confuse you.

Basic data types such as Int, Float and String don't need the New bit, but Types do. (Read my other post and you will get that)