DeleteLocalObject(object, string)
Deletes oObject's object variable sVarName
void DeleteLocalObject( object oObject, string sVarName );
Parameters
oObject
The object storing the variable.
sVarName
Variable name to delete.
Description
Use this function to delete an object's entry for the object defined by sVarName.
Remarks
As with all deletions, once removed, GetLocalObject returns OBJECT_INVALID. Cleaning up old variables can help CPU performance if many are stored on one object (especially a module).
Local objects also do not store the object as such that it finds it each time, but rather its "code" in the object list, which is probably a smaller value then any string you will store upon objects.
Version
1.22
Example
// We delete the object stored on the PC under "WEAPON" when they pull a lever. void main() { // Declare the PC object object oPC = GetClickingObject(); // Delete the local object DeleteLocalObject(oPC, "WEAPON"); }
See Also
categories: | Local Variables Functions |
author: Michael Nork, editor: Jasperre
Send comments on this topic.