Next: GetBuiltinVariableIndex - AurieFramework/YYToolkit GitHub Wiki
Retrieves the index for an instance built-in or global built-in variable.
Syntax
AurieStatus GetBuiltinVariableIndex(
[in] std::string_view Name,
[out] size_t& Index
);
Parameters
Name
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 asroom
,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.
Index
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.
Return Value
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
.