Initializes a loop on the current database to get the elements in the order specified by the BTF/STB system.

    GSErrCode ACAPI_Database (


Return Values

The function has completed with success.

For other common API errors see the API Errors document.



This function is used to set up a loop to get element in the order the server application would draw them onto the display. Once the loop is initialized the APIDb_DrawOrderGetNext function can be called repeatedly to get the element references in order.

The function can be called any time to reset the loop, it is not necessary to scan all the elements to restart the loop.

The order of elements depends on the BTF / STB commands invoked by the user. Also the default ordering can be imported while opening an external file, which format give information on this issue.

Don’t forget to call APIDb_DrawOrderTerm to allow the server application to free its cached data.



API_Elem_Head       elem_head;
GSErrCode           err;

err = ACAPI_Database (APIDb_DrawOrderInitID, nullptr, nullptr);
while (err == NoError) {
    err = ACAPI_Database (APIDb_DrawOrderGetNextID, (void *) (Int32) APIFilt_OnActFloor, &elem_head);
    if (err == NoError) {
        /* ... */
if (err == APIERR_NOMORE)
    err = NoError;



Version: API 4.1 or later
Header: APIdefs_Database.h


See Also

APIDb_DrawOrderGetNext, APIDb_DrawOrderTerm, ACAPI_Database, API Functions