-
Notifications
You must be signed in to change notification settings - Fork 13
Next: GetBuiltinVariableIndex
Retrieves the index for an instance built-in or global built-in variable.
AurieStatus GetBuiltinVariableIndex(
[in] std::string_view Name,
[out] size_t& Index
);
The name of the built-in to look up.
Important
Using this function, you can get the index of either a local built-in (such as id
, image_index
, etc.), or a global built-in (such as room
, instance_count
, etc.).
A global built-in variable IS NOT the same as a regular global variable, and cannot be treated as such - to look up a global variable, use the variable_global_get
built-in function, or the GetInstanceMember function together with the global instance obtained from GetGlobalInstance.
A reference to a buffer, into which the index of the variable is written. This buffer is guaranteed to remain unchanged if the function fails. To access built-in variables via this index, use the GetBuiltinVariableInformation function.
Note
Accessing built-ins via an index is not faster than using GetBuiltin, due to YYTK's caching system.
On success, the function returns AURIE_SUCCESS
and writes the array index of the built-in variable into the Index
buffer. If the function fails, it returns a matching error code. If the internal variable lookup facilities aren't available, the function returns AURIE_MODULE_INTERNAL_ERROR
. If the function referenced by the Name
parameter does not exist, the function returns AURIE_OBJECT_NOT_FOUND
.