home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / FOXPRO / VEDIT060 / README.1ST < prev    next >
Text File  |  1992-09-25  |  28KB  |  711 lines

  1.                                VEDITOR
  2.  
  3.                            BETA VERSION 0.60
  4.  
  5.                      (c) 1992 -- Jayson R. Minard
  6.  
  7. =============================================================================
  8.  
  9.   VEDIT is a free product BUT donations are accepted so that I have
  10.   motivation to continue developing products such as these.  This is
  11.   therefore similar to ShareWare.  Hopefully the time saved by using
  12.   this product is worth a donation <g>...
  13.  
  14.       Jayson R. Minard
  15.       P.O. Box 1306
  16.       Westminster, CO 80030-1306
  17.  
  18.   You will also notice that full source code is included with this release.
  19.   JMAKE or Borland's make utility can be used to compile the libraries.  You
  20.   will need a librarian manager and an assembler to complete the library.
  21.  
  22. =============================================================================
  23.  
  24. Welcome to BETA 6 of the new FORCE memo and text editors.
  25.  
  26. Coming in BETA 7:
  27.  
  28.    - CUA looking support like in ForCIS
  29.  
  30. Changes in BETA 6:
  31.  
  32.    - If a complete line of text with no spaces was wider than the right
  33.      margin then a runtime error would occur...  This is fixed.
  34.  
  35.    - a FLASH parameter added to the internal editor (see bottom of file)
  36.      which allows displaying of the text with immediate exit.
  37.  
  38.  
  39. Changes in BETA 5:
  40.  
  41.    - UnDelete parameter added to editor.  This allows you to specify the
  42.      number of lines kept when using ALT-D to delete.  Then use ALT-U
  43.      to bring them back in the reverse order they were deleted.
  44.  
  45.    I've decided to throw in the kitchen sink, then if you don't want stuff
  46.    you can register and change the source code to get rid of the un-wanted
  47.    items.  This means Search and Replace is back in and will be there
  48.    for the next BETA.
  49.  
  50. Changes in BETA 4:
  51.  
  52.    - NOTE!!!! all of the function names have been changed, sorry but I want
  53.      them to be VEDIT_???? not VLIST_???.  The macros are the same since
  54.      JL stands for a J-Library not for J-List.  Therefore I keep them the
  55.      same.
  56.  
  57.    - Filename is now a passed-by-reference parameter for VEDIT_TEXT_EDITOR()
  58.      in case the user changes the filename.
  59.  
  60.    - save as new filename (but leave original parameter intact for normal save)
  61.      was added as ALT-S.  This requires the window to be at least around 40
  62.      characters so that it has room to ask for the filename.
  63.  
  64.    - save as new filename and change original parameter so that ALT-W now saves
  65.      to this filename is ALT-N.  This also requires a window of at least 40
  66.      characters wide.
  67.  
  68.    - search and replace will NOT be added to the library.
  69.  
  70.    - save/read scrap CTRL-W/CTRL-R
  71.  
  72.    - fixed a bug with CTRL-LEFT and CTRL-RIGHT that messed up the screen.
  73.  
  74.    - you will have to compile NEWMEMO.PRG since the files are getting
  75.      larger and I wanted to keep d/l time lower.  You will need VLIST.ZIP
  76.      from the FORCE BBS if you don't already have it.
  77.  
  78.    Some of these changes add BULK to the final EXE since I now have GETs within
  79.    the library code.  If you already use GETs then you are fine and this bulk
  80.    won't be added.  The FORCE GET code is decently large.  If you do not want
  81.    some of these extra features, then just register the library (when it
  82.    becomes available) and when you get the source code, change it.
  83.  
  84.    The ACTUAL SIZE of bytes that the VEDIT_TEXT_EDITOR() adds to your code
  85.    at this time is right around 40k.  If you use at least 1 GET in your
  86.    program.  Basically, take the NEWEDIT.PRG, comment out the call to
  87.    the editor and recompile.  Look at the difference in size...
  88.  
  89. Changes in BETA 3:
  90.  
  91.    - Display only works (it did in BETA 2, by the way)
  92.  
  93.    - The ALT- ALT+ ALT* ALT/ problem is fixed so that it also works
  94.      for the -,+,*, and / keys anywhere on the keyboard.  For example
  95.      the ALT* is actually ALT-8, just press the key that has that symbol
  96.      on it somewhere.  This can be changed in the keyboard handler, look
  97.      at the last part of the case statement.
  98.  
  99.    - The ALT-<DEL> needs to be the one without the . if num-lock is on!
  100.  
  101.    - Basically all of these scrap things are designed to work on the
  102.      keypad part of the extended keyboard.  I guess I shouldn't say
  103.      keypad since it is that middle part with just the arrows and the
  104.      INSERT/HOME/PGUP/DEL/END/PGDOWN keys.  NOT THE NUMERIC KEYPAD.
  105.      So if you are having problems getting this to work, try the other
  106.      pad.  It works on my machine for ATL+, ALT-, ATL*, ATL/ on either
  107.      keypad, but ALT-<DEL> must be the middle one.
  108.  
  109.    - The <ENTER> when insert is off bug is fixed.  It used to not scroll
  110.      the window correctly.
  111.  
  112. CHECK THE IMPLEMENTED section for what is different.  There are different
  113. parameters since BETA 1 and also between BETA 4 and this one, so watch out!!!
  114. Also added to the DOC section is the return code list for the keyboard handler.
  115. There are also new functions in the HDR file that you can access.
  116.  
  117. With this BETA, you can EDIT files that are shorter than 80 lines
  118. and if they are longer then only VIEW them.
  119.  
  120. These were written in FORCE using the VList library extensively.
  121. The following text contains important information on what the editor
  122. can and can't do.  From BETA to BETA, this text will change in
  123. different places throughout, so please re-read it for each BETA
  124. you down/load.
  125.  
  126. When the final version arrives, it will include a registration
  127. form/file that will give details on registration.  You will also
  128. need VLIST library in order to compile any application using this
  129. library (VEDIT.LIB).  Some functions in VLIST.LIB have been changed
  130. to work better with VEDIT.LIB, so please register VLIST.LIB or you
  131. most likely will not have the correct version.  One of the changes
  132. stops the program from locking up when out of memory.  Source code
  133. will also be made available at a cost in the future.  Therefore you
  134. can use this as a base to write a full text editor, or modify
  135. it to suite your needs.
  136.  
  137. THINGS WILL CHANGE BETWEEN HERE AND THE FINAL VERSION so do not
  138. get too comfortable with the parameters.  I am not sure whether
  139. I will make the colors sent through parameter or leave them as is.
  140.  
  141.  
  142. GENERAL INFORMATION:
  143.  
  144. The editor can be configured for almost any size (please don't try
  145. to make a 4x4 editor, it probablty won't work).  The status line
  146. (LINE/ROW/INSERT/SCRAP) can be positioned at any row,col.  It is
  147. around 40 characters, so it may not always fit at the bottom of your
  148. editor window.
  149.  
  150. The VEditor (I guess we could call it) is based upon a two part
  151. system.  The first part loads a VList with lines of text.  The
  152. lines must ALL be the same length, padded out to whatever the
  153. 'hard-margin' is set to.  This hard-margin is the maximum width
  154. the text may be (132 max).  The list is actually initialized to
  155. 'hard-margin + hard-margin/2' to give room for word wrapping and
  156. a some work space when combining lines and such.  This part is
  157. also responsible for saving the list.  The second part is the
  158. actual editor and does all editing until the user wants to
  159. save or quit, then control is returned to the first part with
  160. a return code.
  161.  
  162. The seperation of VEditor in two parts makes it easy to use this
  163. as either a TEXT or MEMO editor.  Just replace part one's F_?????
  164. calls with M_???? calls.  I already did this for you.  There are
  165. two main functions, VEDIT_TEXT_EDITOR and VEDIT_MEMO_EDITOR.  The
  166. only parameter difference is the first, either file-name or
  167. the memo name.  For the memo name you must include the database
  168. alias...
  169.  
  170.      DBF_TEST->NOTES
  171.  
  172. The VEditor will add some 40K+ to your program, but this is actually
  173. less when you consider some of that contains routines your program
  174. will also use.  Therefore it should be somewhat less.  For example
  175. the @SAY, FILL, F_????, M_????, VLIST_???? functions will not be
  176. added twice, just once.  So if you use VLIST menus already, then
  177. the objects are already included in your program.  If you don't
  178. use any of these then I guess you have a 40k larger program...
  179.  
  180. The 2 functions are covered in the DOC section at the end of this
  181. file.  These are the only two that you will have direct access to
  182. until registering, then there are others such as the word_wrap proc.
  183.  
  184. There is no text marking, YET you can accomplish most of the same
  185. features through the use of the 'scrap'.  This is covered below.
  186.  
  187. The VEditor uses a set line length method of storing the text.  This
  188. means that every line that you type, even if it is empty, will take
  189. up the same space in memory.  When saved, it will be trimmed of all
  190. trailing spaces.  I wrote the editor this way so that it would get
  191. done.  I figured you would live with an editor that could do 2000 line
  192. text files rather than not having one at all.  Its the best I can do
  193. for now.  Whatever you pass as the hard-margin will be the set line
  194. length (actually a little longer).  If you are reading a text file
  195. that has lines out to 132 columns, and hard-margin is set to 90 then
  196. they will be truncated to 90 and THEN word-wrapped.  The max is 132.
  197.  
  198. Some of the items that are mentioned to be implemented may never make
  199. it into V1.0 of VEditor, some will.  This basically means I am not
  200. guaranteeing (SP?) ANYTHING right now.
  201.  
  202.  
  203. NOTEs about the MOUSE SCROLLBAR:
  204.  
  205. The scroll bar is an indicator that shows a relative position within
  206. the file graphically.  This can be displayed with or without mouse
  207. usage.  If a mouse is present, you can scroll the window by pressing
  208. the left button on the top or bottom borders.  By pressing the
  209. buttom within the text area, the cursor moves to that location.
  210. If you press the up-tab or down-tab on the scroll-bar, then the
  211. line moves up or down one at a time.  If you press the button
  212. ON the scroll-bar, the current line will move towards your cursor
  213. 1 page at a time.  There is NO SLIDING thing to grab such as in
  214. windows.  This acts the same as VLIST picklist/menu functions.  Maybe
  215. another day will I make it exactly like CUA but not for now.
  216.  
  217.  
  218. COLOR USAGE:
  219.  
  220. To define which colors the VEditor will use, just set the normal
  221. VList and FORCE colors.  The following shows which colors are
  222. used in which part of the editor.  If this does not work well
  223. for programming, then let me know and I will break them into
  224. more colors and pass them all as parameters (except the main
  225. text color, __color_std, the current line color, __color_enhcd,
  226. and the scroll bar colors).  In other words, you will send the
  227. edit procedure the color values for the status line (hi/lo) and
  228. also for any pop-up windows.  Pop-up windows now use the same
  229. colors as the scroll bar.  Marked-text color is not implemented
  230. since no text marking is in the VEditor.
  231.  
  232.   Colors:
  233.  
  234.     __color_std      = main text color
  235.  
  236.     __color_enhcd    = current line text color
  237.  
  238.     __color_tab      = scroll bar tab AND bright status color AND pop-up
  239.                        window text color
  240.  
  241.     __color_bar      = scroll bar AND dim status color AND pop-up window
  242.                        border color
  243.  
  244.  
  245. IMPLEMENTED FEATURES:
  246.  
  247.      - WORD WRAPPING!!  ( on file-read and during editting )
  248.  
  249.      - Insert/Overwrite mode (press the insert key)
  250.  
  251.      - Pg-Up / Pg-Down  =  move up and down one page height
  252.  
  253.      - Ctrl-Pg-Up / Ctrl-Pg-Down  =   go to top or end of file
  254.  
  255.      - Home  =  go to beginning of line
  256.  
  257.      - End   =  go to end of text on line
  258.  
  259.      - Ctrl-End  =  go to end of line (132th column)
  260.          this will be changed to only go to the right margin.  Right now
  261.          the margin is the word wrap point, not the actual text limitation.
  262.  
  263.      - Ctrl-Up / Ctrl-Down  =  move the window up or down 1 line
  264.  
  265.      - MOUSE works to point to a part of text and to move the text using
  266.        the scroll-bar
  267.  
  268.      - Ctrl-Right / Ctrl-Left = move word right/left
  269.  
  270.      - Ctrl-Y / Alt-D   = delete line
  271.  
  272.      - ALT (keypad) -      = delete line and place at end of scrap
  273.  
  274.      - ALT (keypad) +      = insert line from end of scrap (delete from scrap)
  275.  
  276.      - ALT (keypad) *      = insert all of scrap at current line (keep scrap)
  277.  
  278.      - ALT (keypad) /      = insert all of scrap at current line (delete
  279.                              scrap)
  280.  
  281.      - ALT - <DEL>         = clear scrap buffer
  282.  
  283.      - Right-Mouse-Button  = while mouse cursor is in edit window, delete
  284.                              CURRENT line and place at end of scrap
  285.  
  286.      - Right-Mouse-Button  = while cursor is positioned on the <SCRAP> status
  287.                              line indicator, insert line from end of scrap
  288.                              (delete from scrap)
  289.  
  290.      - ALT-X    = exit
  291.  
  292.      - ALT-W    = write file
  293.  
  294.      - ALT-T    = Toggle word wrap on/off
  295.  
  296.      - The keyboard handler is now a function that is passed as a parameter,
  297.        therefore you can replace it with your own.  From the keyboard
  298.        handler, you can change the window size and any of the other
  299.        parameters passed by reference.  Just read the notes in KEYBOARD.PRG
  300.        (which is the default key handler) about how to do this.  You
  301.        must set REFRESH=.T. before exitting.
  302.  
  303.      - TAB now works as:  When in overwrite, moves the cursor forward the
  304.        defined tab-stop.  When in insert, adds the 'tab-stop' number of
  305.        spaces to the text.  There are no TRUE tabs here.  The tab-stop
  306.        value is passed as a parameter.
  307.  
  308.      - ALT-S   = save to new filename but ALT-W still saves to the old one.
  309.  
  310.      - ALT-N   = save to new filename and ALT-W will now use this filename.
  311.  
  312.      - CTRL-W  = write scrap to filename
  313.  
  314.      - CTRL-R  = read filename and append to scrap
  315.  
  316.      - ALT-U   = undelete last line deleted.
  317.  
  318.  
  319. NON-IMPLEMENTED FEATURES (those not done yet):
  320.  
  321.      - search and replace
  322.  
  323. REPORTING BUGS:
  324.  
  325. If you find any major bugs, please leave a message on the FORCE BBS or CI$
  326. ID 71333,12 or 71740,1606 and let me know EXACTLY what happened.
  327.  
  328.  
  329. DOCS: --------------------------------------------------------------------
  330.  
  331. The following lists the ProtoTypes for the two main edit functions.
  332.  
  333. FUNCTION UINT VEdit_Text_Editor PROTOTYPE
  334.   PARAMETERS        CHAR    filename,;
  335.               VALUE INT     upper_row,;
  336.               VALUE INT     upper_col,;
  337.               VALUE INT     lower_row,;
  338.               VALUE INT     lower_col,;
  339.               VALUE UINT    start_line,;
  340.               VALUE UINT    start_col,;
  341.               VALUE UINT    right_margin,;
  342.               VALUE UINT    hard_margin,;
  343.               VALUE BYTE    m_text_color,;
  344.               VALUE LOGICAL word_wrap,;
  345.               VALUE LOGICAL disp_only,;
  346.               VALUE LOGICAL scroll_bar,;
  347.               VALUE LOGICAL stat_line,;
  348.               VALUE UINT    stat_row,;
  349.               VALUE UINT    stat_col,;
  350.               VALUE LOGICAL is_mouse,;
  351.               VALUE LOGICAL a_embedded,;
  352.               VALUE UINT    tab_stop,;
  353.               VALUE UINT    undelete_lines,;
  354.               UNTYPED       key_handler
  355.              
  356. The return values are as follows:
  357.  
  358.    0 - no errors
  359.    3 - error reading file
  360.    4 - error during edit of file (allows user to save anyway)
  361.    5 - error allocating memory (might just lock up for now)
  362.    6 - cannot open file when trying to save
  363.  
  364. The parameters are:
  365.  
  366.    filename     - PATH+NAME of file to load.  This must be valid.  No checking
  367.                   is done other that making sure it exists, if not then it
  368.                   comes up as a new file.
  369.  
  370.    upper_row    - upper left row coordinate for edit area
  371.  
  372.    upper_col    - upper left column coordinate for edit area
  373.  
  374.    lower_row    - lower right row coordinate for edit area
  375.  
  376.    lower_col    - lower right column coordinate for edit area
  377.  
  378.    start_line   - starting line number in the file to start editting at
  379.  
  380.    start_col    - starting column on 'start_line' to start editting at
  381.  
  382.    right_margin - margin to start word wrapping at
  383.  
  384.    hard_margin  - margin to limit actual text to
  385.  
  386.    m_text_color - ** NOT USED **
  387.  
  388.    word_wrap    - logical of whether editor starts in word wrap mode
  389.  
  390.    disp_only    - logical of whether the file is display only, or can be
  391.                   altered and saved.
  392.  
  393.    scroll_bar   - do you want the scroll bar displayed?  It is displayed at
  394.                   'lower_col + __scroll_offset' just like normal VList stuff.
  395.  
  396.    stat_line    - do you want status line displayed?
  397.  
  398.    stat_row     - row to display status line if 'stat_line' is TRUE
  399.  
  400.    stat_col     - column to display status line if 'stat_line' is TRUE
  401.  
  402.    is_mouse     - is mouse present and driver initialized?
  403.  
  404.    a_embedded   - allow embedded color characters in text.  This slows things
  405.                   down.  The __embed_char is the character used to change
  406.                   the color to __color_hi_std or __color_hi_enhcd for the
  407.                   character immediately following it.
  408.  
  409.    tab_stop     - the number of spaces that one tab is equal to.
  410.  
  411.    undelete_lines - number of lines allowed to un-delete
  412.  
  413.    key_handler  - the UDF function to handle key-strokes and mouse movements.
  414.                   The default that you can use is VEDIT_KEY_HANDLER.
  415.  
  416. ---- AND FOR THE VEDIT_MEMO_EDITOR, just change the first parameter to:
  417.  
  418.    MEMO   memoname
  419.  
  420.      This should be the database alias followed by the name of the field.
  421.      ex.   dbf->memo
  422.            test->notes
  423.            mia_mya->tag
  424.  
  425.  
  426.  
  427. COMPILING/LINKING:
  428.  
  429. Your program must include VLIST.HDR and VEDIT.HDR, also the VMOUSE.HDR
  430. is you are using mouse support.  Other mouse libraries will 'probably'
  431. work since I just go directly to the interrupt.  Then compile:
  432.  
  433.    FORCE /ci /v65000 <filename>
  434.  
  435. If you want to reduce the code a little more, just compile with
  436.  
  437.    FORCE /n /ci /v65000 <filename>
  438.  
  439. to remove stack checking.  I hope your stack is correct, else you may get
  440. lock-ups.  If your program works fine with no run-time errors and it has
  441. been thouroughly tested then use this.
  442.  
  443. Then you must link:
  444.  
  445.    LINK <filename>,,,VEDIT+VLIST+FORCE
  446.  
  447. or
  448.  
  449.   BLINKER FI <filename> SEARCH VEDIT+VLIST+FORCE
  450.  
  451.  
  452.                      ...AND YOU ARE ON YOUR WAY...
  453.  
  454.  
  455.  
  456. *******************************************************************************
  457. * return codes for MEMO editor                                                *
  458. *   0 - no errors                                                             *
  459. *                                                                             *
  460. *   3 - error reading memo                                                    *
  461. *   4 - error editting memo                                                   *
  462. *   5 - error allocating memory                                               *
  463. *   6 - cannot open memo to save                                              *
  464. *******************************************************************************
  465.  
  466. FUNCTION UINT VEdit_Memo_Editor PROTOTYPE
  467.   PARAMETERS  MEMO      memoname,;
  468.               VALUE INT upper_row,;
  469.               VALUE INT upper_col,;
  470.               VALUE INT lower_row,;
  471.               VALUE INT lower_col,;
  472.              VALUE UINT start_line,;
  473.              VALUE UINT start_col,;
  474.              VALUE UINT right_margin,;
  475.              VALUE UINT hard_margin,;
  476.              VALUE BYTE m_text_color,;
  477.           VALUE LOGICAL word_wrap,;
  478.           VALUE LOGICAL disp_only,;
  479.           VALUE LOGICAL scroll_bar,;
  480.           VALUE LOGICAL stat_line,;
  481.              VALUE UINT stat_row,;
  482.              VALUE UINT stat_col,;
  483.           VALUE LOGICAL is_mouse,;
  484.           VALUE LOGICAL a_embedded,;
  485.              VALUE UINT tab_stop,;
  486.              VALUE UINT undelete_lines,;
  487.                 UNTYPED key_handler
  488.  
  489.  
  490. KEYBOARD HANDLER -------------------------------------------------------------
  491.  
  492. The keyboard handler is passed as a parameter to the edit routine and it will
  493. be called everytime a mouse button is pressed or a key-stroke is done.  The
  494. resulting code can be altered or changed to cause the editor to react
  495. differently to each action.
  496.  
  497. An easy way to change this is to create your own keyboard handler that uses
  498. the same PROTOTYPE as the VEDIT_KEY_HANDLER and have it filter key-strokes
  499. and then call the VEDIT_KEY_HANDLER and then filter actions before
  500. returning to the editor.  OR you can copy the file KEYBOARD.PRG and
  501. make your own.  I would rename the file AND the function name to
  502. something different to preseve the old one since you might want something
  503. different for each program.
  504.  
  505. The key handler works very similar to the VLIST key handlers.  Read the
  506. VLIST key handlers for information on how the mouse works and for the
  507. normal keyboard activities.  These DOCs come with the registered version
  508. of VLIST.
  509.  
  510. The following is a list of NEW macros beyond the VLIST macros that
  511. have an effect on the editor.  Some ARE NOT implemented yet but have
  512. a value.  These have an (*) in the left column.
  513.  
  514.     &JL_SAVE_EXIT     - exit the editor but ask to save first
  515.     &JL_SAVE_CONTINUE - save the file and continue editting
  516. *   &JL_START_MARK    - start marking at the current line
  517. *   &JL_END_MARK      - end marking at the current line
  518.     &JL_TOGGLE_WRAP   - turn word wrap on/off
  519. *   &JL_MARK_LINE     - mark this one line
  520. *   &JL_UNMARK_ALL    - unmark all marked text
  521. *   &JL_DELETE_MARKED - delete marked text
  522. *   &JL_SAVE_MARKED   - save marked text
  523. *   &JL_COPY_MARKED   - copy marked text to current location
  524. *   &JL_MOVE_MARKED   - move marked text to current location
  525. *   &JL_IMPORT        - import a file to the current location
  526.     &JL_SAVE_AS       - save the file to a new filename, same as &JL_SAVE_AS_NEW
  527.     &JL_DELETE_LINE   - delete current line
  528.     &JL_DELETE_TO_SCRAP - delete current line and place at end of scrap
  529.     &JL_SAVE_SCRAP      - save scrap to disk
  530.     &JL_READ_SCRAP      - read file and append to scrap
  531.     &JL_DELETE_SCRAP    - delete all of scrap
  532.     &JL_COPY_ALL_SCRAP  - copy all of scrap to current location and retain scrap
  533.     &JL_COPY_TOP_SCRAP  - copy the top line of the scrap and delete it
  534.     &JL_COPY_BOTTOM_SCRAP - copy the bottom line of the scrap and delete it
  535.     &JL_COPY_ALL_SCRAP_DELETE - copy all of the scrap to the current location
  536.                                 and delete the whole scrap.
  537.     &JL_SAVE_AS_NEW  - save file as a new filename, the old filename is retained
  538.                        for a normal save.
  539.     &JL_SAVE_RENAME  - save file as a new filename, all saves will now use this
  540.                        filename.
  541.     &JL_UNDELETE_LINE - undelete last line deleted
  542.  
  543. The prototype for the edit handler is:
  544.  
  545.   FUNCTION INT VEdit_Key_Handler PROTOTYPE
  546.     PARAMETERS VALUE LONG    list_handle,;
  547.                      UINT    list_element,;
  548.                      UINT    list_column,;
  549.                      UINT    mouse_stat,;
  550.                VALUE UINT    mrow,;
  551.                VALUE UINT    mcol,;
  552.                       INT    pick_key,;
  553.                      UINT    top_element,;
  554.                VALUE UINT    last_element,;
  555.                      UINT    ur,;
  556.                      UINT    uc,;
  557.                      UINT    lr,;
  558.                      UINT    lc,;
  559.                      UINT    stat_row,;
  560.                      UINT    stat_col,;
  561.                VALUE LOGICAL display_only,;
  562.                      LOGICAL refresh
  563.  
  564.  
  565. OTHER FUNCTIONS --------------------------------------------------------------
  566.  
  567.   PROCEDURE VEdit_Change_Byte PROTOTYPE
  568.     PARAMETERS VALUE UINT position,;
  569.                VALUE INT  new_byte,;
  570.                      CHAR full_str
  571.  
  572.   Changes one bye within a passed string.
  573.  
  574.   *****
  575.  
  576.   FUNCTION UINT VEdit_Forward_Space PROTOTYPE
  577.     PARAMETERS CHAR temp_str,;
  578.                UINT current_col
  579.  
  580.   Returns the position of the next space in a string starting at the
  581.   'current_col'.  If there are no more spaces, it returns a 0.  If
  582.   current_col is not at the end of the line, and there are no more
  583.   spaces then the cursor is moved to the position after the last letter
  584.   on the line.  If the cursor is already past the last letter, then a
  585.   0 is returned.
  586.  
  587.   *****
  588.  
  589.   FUNCTION UINT VEdit_Backward_Space PROTOTYPE
  590.     PARAMETERS CHAR temp_str,;
  591.                UINT current_col
  592.  
  593.   Returns the position of the last space in a string starting at the
  594.   'current_col'.  If there are no more spaces, it returns a 0.  It will
  595.   return 1 if current_col is > 1 and there are no spaces to the left.  If
  596.   current_col = 1, then it will return 0.  This was designed for the
  597.   CTRL-LEFT movement.
  598.  
  599.   *****
  600.  
  601.   FUNCTION UINT VEdit_Last_Space PROTOTYPE
  602.     PARAMETERS VALUE UINT right_margin,;
  603.                      CHAR temp_str
  604.  
  605.   Returns the last space in a string starting at the right margin and
  606.   working its way backwards.  Designed for the word wrapping.
  607.  
  608.   *****
  609.  
  610.   PROCEDURE VEdit_Word_Wrap PROTOTYPE
  611.     PARAMETERS VALUE LONG handle,;
  612.                VALUE UINT mini,;
  613.                VALUE LOGICAL blp,;  && stop on first blank
  614.                VALUE UINT right_margin,;
  615.                VALUE UINT hard_margin,;
  616.                      UINT current_element,;
  617.                      UINT current_column
  618.  
  619.   This word wraps lines in the list starting at 'mini' and going forward.
  620.   'BLP' means to stop after what it considers a paragraph OR if it finds
  621.   the first line that does not need wrapping.  If BLP is .T., then the
  622.   'current_element' and 'current_column' are updated to move the cursor
  623.   to the line that they should be on in case the text to the left of
  624.   the current position is wrapped to the next line.  If BLP is .F. then
  625.   the complete list from 'mini' to the end is checked.
  626.  
  627.   Right_margin is the word-wrap margin, while hard-margin is the actual
  628.   text limit.
  629.  
  630.   *****
  631.  
  632.   The following #DEFINES are returned from the VEDIT_INTERNAL_EDITOR
  633.   to either VEDIT_TEXT_EDITOR or VEDIT_MEMO_EDITOR as the current state.
  634.  
  635.   #DEFINE edit_error
  636.  
  637.     an error occured during editting.
  638.  
  639.   #DEFINE edit_none
  640.  
  641.     nothing significant happened, just exit.
  642.  
  643.   #DEFINE edit_save_exit
  644.  
  645.     ask to save, then exit.
  646.  
  647.   #DEFINE edit_save_continue
  648.  
  649.     save and then continue editting.
  650.  
  651.   #DEFINE edit_continue
  652.  
  653.     just continue editting in case someone resized the window and I want
  654.     to run through the VEDIT_INTERNAL_EDITOR initialization which
  655.     does all of the boundary checking and so on...
  656.  
  657.   #DEFINE edit_save_as_new
  658.  
  659.     save file to new filename, retain old filename for saving to later,
  660.     go back and continue editting.
  661.  
  662.   #DEFINE edit_save_rename
  663.  
  664.     save file to new filename and use this filename from now on for future
  665.     saves.  Go back and continue editting.
  666.  
  667.   #DEFINE edit_save_scrap
  668.  
  669.     save scrap to filename and continue editting
  670.  
  671.   #DEFINE edit_read_scrap
  672.  
  673.     read a file and append to end of scrap
  674.  
  675.   *****
  676.  
  677.   FUNCTION UINT VEdit_Internal_Editor PROTOTYPE
  678.     PARAMETERS VALUE LONG    handle,;
  679.                VALUE LONG    scrap,;
  680.                VALUE LONG    undelete,;
  681.                VALUE INT     upper_row,;
  682.                VALUE INT     upper_col,;
  683.                VALUE INT     lower_row,;
  684.                VALUE INT     lower_col,;
  685.                      UINT    top_element,;
  686.                      UINT    initial_element,;
  687.                      UINT    left_col,;
  688.                      UINT    initial_col,;
  689.                      UINT    right_margin,;   && max 132
  690.                VALUE UINT    hard_margin,;
  691.                VALUE BYTE    marked_text_color,;
  692.                      LOGICAL word_wrap,;
  693.                VALUE LOGICAL display_only,;
  694.                VALUE LOGICAL flash,;
  695.                VALUE LOGICAL scroll_bar,;
  696.                VALUE LOGICAL stat_line,;
  697.                VALUE UINT    stat_row,;
  698.                VALUE UINT    stat_col,;
  699.                VALUE LOGICAL is_mouse,;
  700.                VALUE LOGICAL allow_embedded,;
  701.                VALUE UINT    tab_width,;
  702.                VALUE UINT    undelete_lines,;
  703.                      UNTYPED key_handler
  704.  
  705.   This is the internal version of the editor which just edits a VLIST.  The
  706.   parameters are similar to VLIST_TEXT_EDIT and VLIST_MEMO_EDIT except
  707.   for the parameter FLASH which will cause the text to be displayed and
  708.   then the editor immediately exitted.
  709.  
  710.  
  711.