Foxtools – Editor _EDINDENT

Version: 01.00.10 - last Update: Tuesday, October 13, 2009, 12:00:00

Previous ChapterFoxtools Home (Alphabetical TOC)Foxtools Home (Grouped TOC)Next Chapter See also:_EdOpenFil | _EdCloseFi | _EdRevert | _EdSelect | _EdInsert | _EdSendKey | _EdDelete | _EdComment 

Foxtools Editor Support Functions


_EdIndent() Indents text by inserting a number of tab stops in the editor session passed in <nWHAND> parameter.

VFP Syntax

= _EdIndent(nWHAND, nTabCount)


[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] nTabCount

Number of tab stops that will be inserted at the current caret position.


VOID - no evaluable return value, coz always TRUE.


Passing negative <nTabCount> values into _EdIndent() un-indents the text.

VFP Example(s)

Opening an editor session, indenting text on line #2 then un-indenting it:

*\\ Open editor session
*\\   use file with at least 3 lines of text
*\\ get offset to BOL of last line
lnLines = _EdGetLNum(m.nWHAND, _EdGetLPos(m.nWHAND, -1))+1
IF m.lnLines > 2 && one-based numbering here
  *\\ get BOL offset for 2nd line
  nOffset = _EdGetLPos(m.nWHAND, 1)
  *\\ set caret to BOL of 2nd line
  _EdSetPos(m.nWHAND, m.nOffset)
  *\\ Insert 3 tab stops
  = _EdIndent(m.nWHAND, 3)
  *\\ Un-indent 2 tab stops
  = _EdIndent(m.nWHAND, -2)
  ? "not enough lines in file"

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