Author Topic: How to clear out an array.  (Read 662 times)

For example, if I had $Array[0,1,0] and like 1000's of other values in that array, how would I go about making every value set in it to 0?

Edit: I just used a new scriptObject and attached the values to it along with a count. Then I just scrolled through.
« Last Edit: May 26, 2009, 03:18:59 PM by Azimuth »

deleteVariables("$Array*");
(The * is a wildcard.)

deleteVariables("$Array*");
(The * is a wildcard.)
Wow, thanks!

Can someone explain to me how to use script objects? I think it would help...

Can someone explain to me how to use script objects? I think it would help...
Just use chrono's example, it's much better.

Can someone explain to me how to use script objects? I think it would help...
A scriptObject is basically an object that does nothing but store values.
Simply create a new ScriptObject with the method you desire:
Code: [Select]
$Something = new ScriptObject();
//or
new ScriptObject(Something);

Then start addin' stuff to it, and making functions related to it. (functions only if you choose the second method.)
Like
Code: [Select]
Something.value[%x] = %client.money;
//or
function Something::DoStuff(%this,%stuff,%do)
{
//stuff
}

What do the pop() and push() functions do for Script objects? I've only ever seen those in GUI's.

Also, remember, there are different objects such as TCPObject, that have pre-defined functions that do stuff, and you're free to add your own functions and variables.

What do the pop() and push() functions do for Script objects? I've only ever seen those in GUI's.
They open and close GUIs.

If you need to reset every variable in a scriptobject, delete it and remake it. Every variable will equate to a blank string.