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

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

VFP Syntax

= _EdIndent(nWHAND, nTabCount)

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

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

Returns

VOID - no evaluable return value, coz always TRUE.

Remarks

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:

CLEAR
*\\ Open editor session
*\\   use file with at least 3 lines of text
nWHAND =_EDOPENFIL("TEST.TXT", 1)
*\\ 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)
ELSE
  ? "not enough lines in file"
ENDIF

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