PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Pages

Show deprecated

Pages

Show deprecated

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

bool

IsFinished

[ReadOnly] [NotReplicated]

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

Functions

void

AdvanceToNextPageAsync ( )

[Yields]

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

Array

GetCurrentPage ( )

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

Events