GetLocalArrayInt(object, string, int)

Simulates retrieving an Integer from an array on an object.

int GetLocalArrayInt(
    object oidObject,
    string sVarName,
    int nVarNum
);

Parameters

oidObject

The object the array of integers is stored on.

sVarName

The name of the array.

nVarNum

The position in the array the value should be retrieved from.


Description

Returns the value found in position nVarNum in array sVarName stored on object oidObject.



Remarks

Function found in nw_o0_itemmaker.nss on line 600.

Although this is hardly an array, it can be accessed like one, and can even be looped through. It works by creating a new local integer object on whatever object you passed in through the parameters. This LocalInt is called sVarName + nVarNum, so in otherwords if I called the following:

GetLocalArrayInt(OBJECT_SELF, "MyArray", 1);

meaning I want the value in position one of MyArray on OBJECT_SELF. It would call GetLocalInt(OBJECT_SELF, "MyArray1") to retrieve the value. So if you create one array and have 300 values stored in it, you've actually created 300 variables with values on the object. This just hides the mess for you.


Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

functions: GetLocalInt | SetLocalArrayInt
categories: Local Variables Functions


 author: John Shuell