Foxtools – Editor _EDCOMMENT

Version: 01.00.00 - last Update: Tuesday, October 06, 2009, 14:30:00

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


Foxtools Editor Support Functions

_EDCOMMENT

_EdComment() Comments highlighted text in an editor session passed in <nWHAND> parameter.

VFP Syntax

= _EdComment(nWHAND, nCommentCount)

Parameters

[in] nWHAND

Fox-window handle of the editor session to be closed.

[in] nCommentCount

Count of comment marks. The format of the comment marks can be defined via VFP’s Option-dialog.

Returns

VOID - no evaluable return value, coz always TRUE.

Remarks

The comment marks are stored in the registry under: HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\9.0\Options\EditorCommentString.

VFP Example(s)

Opening a new editor session, putting some text in and finally commenting some lines:

PUBLIC gEdit AS EditorSession
LOCAL lcText AS STRING
*\\ open some text file using read/write mode
gEdit = _EDOPENFIL("New.Prg", 2)
*\\ if GETFILE() cancelled, gEdit will be negative
IF m.gEdit > -1
  *\\ success - editor session is open
  lcText = REPLICATE("Hello world"+CHR(13),30)
  *\\ let's make session buffer dirty
  = _EDINSERT(m.gEdit, m.lcText ,LEN(m.lcText))
  *//
  *\\ SELECT lines 11 to 21
  = _EDSELECT(m.gEdit, 121,241)
  *\\ Comment out selected lines
= _EDCOMMENT(m.gEdit, 1) ENDIF

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