Table of Contents

TTMSMCPCursor.Decode Method

Recovers the position that a cursor string was encoded from.

API unit family: TMS.MCP.Pagination Declaring type: TTMSMCPCursor

Syntax

class function Decode(const ACursor: string; out AIndex: Integer): Boolean; static;

Remarks

No exception escapes: a malformed cursor is reported through the result, and callers normally treat a failed decode as a request for the first page. The number is not range checked, so a decoded index may be negative or larger than the collection; validate it against the current entry count before indexing with it.

Parameters

Name Description
ACursor Cursor string exactly as it was received from the client.
AIndex Receives the decoded zero-based index. It is set to 0 before decoding starts, so the value is always defined on return even when decoding fails.

Returns

True when the cursor decoded to a whole number, False when it was not valid Base64 or did not hold a number.