Version: 01.00.10 - last Update: Tuesday, October 13, 2009, 11:40:00
_EdActive | _EdSToPos | _EdSToSel
Foxtools Editor Support Functions
_EDSETPOS
_EdSetPos() Sets new caret position in the editor session passed in <nWHAND> parameter.
VFP Syntax
= _EdSetPos(nWHAND, nPosition)
Parameters
[in] nWHAND
Fox-window handle of the editor session in question. If nWHANDL is no valid editor-session handle, an error “API call caused an exception” (Error 2028) is raised.
[in] nPosition
New offset position of the caret from beginning of the file. The <nPosition> value is zero-based. CRs @ EOL are counted as well.
Returns
VOID - no evaluable return value, coz always TRUE.
Remarks
Note: You can move the caret out of the buffer to the left by passing negative <nPosition> values in! The caret disappears then! Trying to get it back pressing the right arrow key on the keyboard may cause funny/weird effects, depending on how “far” the caret was moved outside. If you pass a <nPosition> value higher than the file size, the caret is positioned at the end of the text buffer (no “moved out” over buffer’s boundary to the right).
VFP Example(s)
Opening an editor session, toggling word wrap:
*\\ Open editor session nWHAND =_EDOPENFIL("TEST.TXT", 1) *\\ Set new caret position to 9 = _EdSetPos(m.nWHAND, 10)