Help Center

CTextRange2.MoveEndUntilmethod

Moves the end of the range either *Count* characters or just past all contiguous characters that are found in the set of characters specified by *Cset*, whichever is less.

Windowsmethoddocumented

Syntax

FUNCTION MoveEndUntil (BYVAL Cset AS VARIANT PTR, BYVAL Count AS LONG = tomForward) AS LONG

Parameters

NameDescription
CsetThe character set to use in the match. This could be an explicit string of characters or a character-set index. For more information, see Character Match Sets.
CountMaximum number of characters to move past. The default value is tomForward, which searches to the end of the story. If Count is greater than zero, the search moves forward (toward the end of the story). If Count is less than zero, the search moves backward (toward the beginning of the story). If Count is zero, the end position is unchanged.

Return value

The actual number of characters that the range end is moved, plus 1 for a match if Count is greater than zero, and –1 for a match if Count is less than zero.

Description

Moves the range's end to the character position of the first character found that is in the set of characters specified by Cset, provided that the character is found within Count characters of the range's end.

Remarks

If no character from the set specified by Cset is found within Count positions of the range's end, the range is left unchanged. If the new end precedes the old start, the new start is set equal to the new end.

The motion described by MoveEndUntil is logical rather than geometric. That is, motion is toward the end or toward the start of a story. Depending on the language, moving to the end of the story could be moving left or moving right.

For more information, see Move.

Reference

  • Defined in AfxNova/CTextRange2.inc:577
  • Documented in Windows/WIndows Controls/RichEdit/CTextRange2 Class.md
  • Topic: CTextRange2 Class