API:Class/Pages

Abstract: This object is abstract. It cannot be created with Instance.new, and its members are inherited by other classes.
Filtered-inheritance mode: While this class technically inherits all Instance class members, some (if not all) have been hidden because they serve no purpose for this object.

Object Icon.pngPages : Object Icon.pngInstance

An object which is essentially a table of pages, each of which is a sorted list of the key/value pairs.

When each page contains a list of multiple items, this iterator function may be handy:

function iterPageItems(pages)
    return coroutine.wrap(function()
        local pagenum = 1
        while true do
            for _, item in ipairs(pages:GetCurrentPage()) do
                coroutine.yield(item, pagenum)
            end
            if pages.IsFinished then
                break
            end
            pages:AdvanceToNextPageAsync()
            pagenum = pagenum + 1
        end
    end)
end

Which can be used as

for item, pageNo in iterPageItems(myPageObject) do
    -- look at item. Pages will advance automatically
end

Properties

Properties [toggle]

boolIsFinished [readonly]

Whether or not the current page is the last page available.

|RMD member="API:Class/Pages/IsFinished"|Whether or not the current page is the last page available.|/RMD|
IsFinished [readonly]
Whether or not the current page is the last page available.

Functions

Functions [toggle]

array<Variant>GetCurrentPage ( )

Returns the items on the current page. The keys in the item are determined by the source of this object.

|RMD member="API:Class/Pages/GetCurrentPage"|Returns the items on the current page. The keys in the item are determined by the source of this object.|/RMD|
Returns the items on the current page. The keys in the item are determined by the source of this object.

YieldFunctions

YieldFunctions [toggle]

voidAdvanceToNextPageAsync ( )

Iterates to the next page in the pages object, if possible.

|RMD member="API:Class/Pages/AdvanceToNextPageAsync"|Iterates to the next page in the pages object, if possible.|/RMD|
Iterates to the next page in the pages object, if possible.


Inherited Classes

Pages.pngDataStorePages
Pages.pngFriendPages
Pages.pngInventoryPages
Pages.pngStandardPages
|RMD member="API:Class/Pages"|An object which is essentially a table of pages, each of which is a sorted list of the key/value pairs. When each page contains a list of multiple items, this iterator function may be handy:
function iterPageItems(pages)
    return coroutine.wrap(function()
        local pagenum = 1
        while true do
            for _, item in ipairs(pages:GetCurrentPage()) do
                coroutine.yield(item, pagenum)
            end
            if pages.IsFinished then
                break
            end
            pages:AdvanceToNextPageAsync()
            pagenum = pagenum + 1
        end
    end)
end
Which can be used as
for item, pageNo in iterPageItems(myPageObject) do
   -- look at item. Pages will advance automatically
end
|/RMD|