Skip to content

Next: GetArrayEntry

Archie_UwU edited this page Jan 2, 2024 · 2 revisions

Retrieves a pointer to an element from within a GameMaker array.

Syntax

AurieStatus GetArrayEntry(
    [in]  RValue&  Value,
    [in]  size_t   ArrayIndex, 
    [out] RValue*& IndexedValue
);

Parameters

Value

A non-const reference to a variable of type VALUE_ARRAY. You can get this reference to an existing variable by calling GetInstanceMember on an existing instance, or by creating a new RValue on the stack.

ArrayIndex

The index of the element to retrieve within the array. Valid values range from 0 up to array_length(Value) - 1.

IndexedValue

A reference to a pointer-sized buffer, into which the pointer to the variable at index ArrayIndex will be written. If the function fails, the value stored within this buffer is guaranteed to remain unchanged.

Return Value

The function returns AURIE_SUCCESS on success, otherwise returns a matching error code. If the information needed for looking up array elements isn't available, the AURIE_MODULE_INTERNAL_ERROR status code is returned. The function returns AURIE_INVALID_PARAMETER if the lookup failed due to ArrayIndex exceeding the size of the array, or if the Value argument isn't an array. If the function failed to determine the array size, AURIE_EXTERNAL_ERROR is returned.

Quick Access

Documentation

Writeups

Clone this wiki locally