Foxtools – Editor _EDOPENFIL

Version: 01.50.00 - last Update: Tuesday, October 13, 2009, 11:55:00

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


Foxtools Editor Support Functions

_EDOPENFIL

_EdOpenFil() Starts a new editor session and opens a file from disk for reading or editing in that new session.

VFP Syntax

nWHAND = _EdOpenFil(cFileName, nEditMode)

Parameters

[in] cFileName

The fully qualified file name has to passed in here. The extension (PRG | TXT | H | INI) has no effect on the session type created. _EdOpenFil() ALWAYS creates a pure TXT editor session (just like VFP’s MODIFY FILE command does). If we want to create a PRG session we have to use VFP’s MODIFY COMMAND command and then get the the new fox-window’s handle utilizing Foxtools’ _WONTOP() function!

[in] nEditMode

The edit mode to be used for the editor session. This can be one of the following:

  • #DEFINE ED_READONLY      0
  • #DEFINE ED_WRITEONLY    1
  • #DEFINE ED_READWRITE    2

Returns

Numeric – Fox-window handle of the new editor session.

Remarks

If the file passed in <cFileName> does not exist an empty editor session will be started with the file name as the caption.

Note: the caption always uses transformed file name using LOWER(JUSTFNAME(m.cFileName)). This is important if one has to locate an open editor window using Foxtool’s _WFindTitl() function (or Win-API equivalent).

VFP Example(s)

Opening an editor session:

*\\ Open editor session
*\\   in read/write mode
nWHAND =_EDOPENFIL("TEST.TXT", 2)


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