Objetc Type

Blitz3D Forums/Blitz3D Programming/Objetc Type

Yue(Posted 2014) [#1]
Type auto
	Field  Num%
End Type


Local Auto.auto[10]  


Auto.auto[0] = New auto ; Error.


I'm doing something wrong, or can not do this?


Floyd(Posted 2014) [#2]
Blitz arrays insist that you do not use the "type tag" after the array is created. Use the name only:

Type auto
	Field  Num%
End Type


Local Auto.auto[10]  

;Auto.auto[0] = New auto ; Error.

Auto[0] = New auto ; No Error.



Yue(Posted 2014) [#3]
Ok, no problem if Array Dim.

Type auto
	Field  Num%
End Type


Dim Auto.auto(10)  

For X% = 0 To 100 
	
	Auto.auto(0) = New auto 
	Auto.auto(0)\Num% = X%
	Print Auto.auto(0)\Num 
	
	
Next 

WaitKey()