Foxtools – Editor _EDSKIPLIN

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

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


Foxtools Editor Support Functions

_EDSKIPLIN

_EdSkipLin() Calculates offset position (@BOL) relative to another offset moving <nLineCount> lines up or down in the editor session passed in <nWHAND> parameter.

VFP Syntax

nPosition = _EdSkipLin(nWHAND, nOffset, nLineCount)

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

Offset position counted from beginning of the file. The <nOffset> value is zero-based. CRs @ EOL are counted as well.

[in] nLineCount

New offset position is <nLineCount> lines up or down from <nOffset> position depending on sign of <nOffset> value. Line numbering is zero-based, too!

Returns

Numeric – the new offset position of BOL of new target line.

Remarks

When calling the _EdSkipLin() function, the following workflow is started:

  1. The line number of the line that holds <nOffset> position is calculated.
  2. The new position is moved up or down <nLineCount> lines.
  3. The new offset position is set to the begin of the target line (BOL).
  4. This position is returned from the function.

If <nLineCount> exceeds max lines, EOF position is returned.

VFP Example(s)

Opening an editor session, setting caret to offset 10, then moving caret 3 lines down:

*\\ Open editor session
nWHAND =_EDOPENFIL("TEST.TXT", 1)
*\\ Set caret to BOL of line 3
= EdSetPos(m.nWHAND, _EdSkipLin(m.nWHAND, 0, 2))

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