Mini array
by Erik Madison · in Torque Game Engine · 09/07/2004 (8:35 am) · 1 replies
I need a list in script, very simple.
{'a', 'b', 'c'} This would be static. Next I need a small fuction to see if an element exists in the list, IsElement(%input) {} For the life of me, I can't figure out how to do this only in script, although I'm pretty sure TS can do it. I know how to do it in c++, but I don't need that kind of overhead. I also am familiar with Daniel Nielsens arrayobject script addon, but that also contains too much overhead for my current need. (not to mention I can't get it to work anyways:))
Anyone?
{'a', 'b', 'c'} This would be static. Next I need a small fuction to see if an element exists in the list, IsElement(%input) {} For the life of me, I can't figure out how to do this only in script, although I'm pretty sure TS can do it. I know how to do it in c++, but I don't need that kind of overhead. I also am familiar with Daniel Nielsens arrayobject script addon, but that also contains too much overhead for my current need. (not to mention I can't get it to work anyways:))
Anyone?
About the author
Torque Owner Bruno Grieco
$list[1]='a';
$list[2]='b';
to search the list all you need is a for... if($list[%i]==%input) return true;