array.length = error

BlitzMax Forums/BlitzMax Beginners Area/array.length = error

BlackSp1der(Posted 2006) [#1]
Why I get an error when I use length with arrays?
According with de docs... :
Arrays also provide a read-only length field that returns the total number of elements in the array.

Strict

Type MyType

	Field Slots:Int[]

	Method New()
		Slots=Slots[..10]
		Print Len(Slots) ' OK


		Print Slots.Length() ' ERROR expression of type INT cannot be invoked
	EndMethod
EndType

Local test:MyType=New MyType



H&K(Posted 2006) [#2]
It prvides a field or a function?


skidracer(Posted 2006) [#3]
A field is not a function so use
Print Slots.Length



BlackSp1der(Posted 2006) [#4]
hehe, thanks.
XD