Game Development Community

Array

by vijay kandrikar · in Torque Developer Network · 03/10/2009 (5:37 am) · 3 replies

somebody help me out
i am trying
$arr = new array();

but i am getting following error

"unable to instantiate non-conobject class array"

About the author

Recent Threads


#1
03/20/2009 (7:51 am)
@Vijay,
You'll have to declare it like $arr[10].

After that, you can do something like this.
$arr[0] = "some value";
#2
03/20/2009 (8:02 am)
Further, I'd recommend doing:
$arr = new ScriptObject();

Just in case you want to pass it into functions. I find it gives me weird trouble otherwise when passing it around.
#3
03/21/2009 (7:54 pm)
www.garagegames.com/community/resources/view/4711

This is a very useful resource that allows arrays to be accessible on the console (your $a = new Array(); example would work with this resource). The console array has many useful features, like sorting, cropping, cleaning, etc. It's awesome.