JavaScript Editor js editor     Web development 

Main Page

Selects the range between the two specified offset positions, inclusive, of the file in the designated editing window.

void _EdSelect(WHANDLE wh, EDPOS startPos, EDPOS endPos)
WHANDLE wh;            /* Handle of editing window. */
EDPOS startPos;         /* Beginning offset position of selection. */
EDPOS endPos;         /* Ending offset position of selection. */


The following example opens for editing a file specified by a parameter, selects the first character in the file using _EdSelect(В ), copies the selection to the clipboard using _EdCopy(В ), and pastes it after the second character using _EdPaste(В ).

Visual FoxPro Code

В Copy Code
= EDCOPY("x")

C Code

В Copy Code
#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
#define pFILENAME ((char FAR *) _HandToPtr(parm->p[0].val.ev_handle))

   WHANDLE wh;

   if (!_SetHandSize(parm->p[0].val.ev_handle, 
      _Error(182); // "Insufficient memory"
   pFILENAME[parm->p[0].val.ev_length] = '\0';

   wh = _EdOpenFile(pFILENAME, FO_READWRITE);

   _EdSelect(wh, 0, 1);
   _EdSetPos(wh, 2);

FoxInfo myFoxInfo[] = {
   {"EDCOPY", (FPFI) Example, 1, "C"},
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo

See Also

JavaScript Editor js editor     Web development