StringParser::GetDistanceFromState (open)

Returns the difference in characters from a saved state to the current position.

Syntax

LOADLIB "wh::util/stringparser.whlib";

INTEGER FUNCTION GetDistanceFromState(RECORD state)

Parameters

RECORD state

Saved state from SaveState

Return value

INTEGER

Number of characters from the saved state to the current position

Examples

OBJECT p := NEW StringParser("test");
RECORD oldstate := p->SaveState();
p->ParseN(2);
// Returns 2
INTEGER distance := p->GetDistanceToState(oldstate);