Foxtools – Editor _EDGETCHAR

Version: 01.10.00 - last Update: Tuesday, October 138, 2009, 12:35:00

Previous ChapterFoxtools Home (Alphabetical TOC)Foxtools Home (Grouped TOC)Next Chapter See also:_EdGetLNum | _EdGetLPos | _EdGetPos | _EdGetStr | _EdPosInVi | _EdSkipLin

Foxtools Editor Support Functions


_EdGetChar() Returns a character at a given position (passed in <nPosition> parameter)  in the editor session passed in <nWHAND> parameter.

VFP Syntax

cCharacter = _EdGetChar(nWHAND, nPosition)


[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

Position (byte count) from beginning of the file. Position value is zero-based.


(Single) Character.


While evaluating the nPosition parameter, _EdGetChar() counts all characters in the editor’s text buffer from the beginning starting with value 0. Thus, the very first character in the buffer hast a nPosition value of <0>. CRs at the end of each line are counted as well! It makes no difference if one has checked “Save with line feeds” in Edit Properties dialog, coz VFP drops all LFs while loading the file content into its editor buffer. Visually, the character right from the caret is returned, if one uses the caret’s position value returned by _EDGetPos().

Note: If nPosition points to the end of the editor’s text buffer (@ EOF) or beyond EOF, then always CHR(32) is returned!!

VFP Example(s)

Opening an editor session, returning character right from the caret:

*\\ Open editor session
*\\ Caret is on nPosition=0 after opening
*\\ Return 1st character after caret
*\\ Close editor session

Previous ChapterFoxtools Home (Alphabetical TOC)Foxtools Home (Grouped TOC)Next Chapter