home *** CD-ROM | disk | FTP | other *** search
/ Best Objectech Shareware Selections / UNTITLED.iso / boss / word / text / 001 / example.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-12  |  1.2 KB  |  32 lines

  1. /****************************************************/
  2. /* This a very simple example of an E! API program  */
  3. /* changing the current text line for a new one     */
  4. /****************************************************/
  5. /******************************************************************************/
  6. /*  PLEASE COMPILE WITH TURBO C -ml LARGE MODEL OPTION                        */
  7. /*  run from the E! command line : @example                                   */
  8. /******************************************************************************/
  9.  
  10. #include "api.h"
  11. #include <string.h>
  12.  
  13. char far *editbufferptr;
  14. char exstring[] = "Here I am. I replaced the original text line!";
  15.  
  16. void main ()
  17.  
  18. {
  19.  editbufferptr = (char far *) Request_E_Address(EDITBUFF_REQUEST);
  20.     /* Retrieve Editbuffer address */
  21.  editbufferptr[0] = strlen(exstring);
  22.     /* It's a PASCAL string - set first byte to exstring length */
  23.  strcpy(editbufferptr + 1, (char far *) exstring);
  24.     /* Load string after first byte */
  25.  Request_E_Service(STORE_SERVICE);
  26.     /* Store it */
  27.  Request_E_Service(DISPLINE_SERVICE);
  28.     /* Display it */
  29.  Request_E_Service(CHANGE_SERVICE);
  30.     /* Notify the change */
  31. }
  32.