home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / FOXPRO / VEDIT060 / SOURCE / VEDIT5.PRG < prev    next >
Text File  |  1992-03-23  |  1KB  |  69 lines

  1. #INCLUDE KEYS.HDR
  2. #INCLUDE vlist.hdr
  3. #INCLUDE vmouse.hdr
  4. #INCLUDE vedit.hdr
  5. #INCLUDE STRING.HDR
  6.  
  7. FUNCTION UINT VEdit_Backward_Space
  8.   PARAMETERS CHAR temp_str,;
  9.              UINT current_col
  10.  
  11.   VARDEF
  12.     BYTE    full_byte[ 250 ] based temp_str
  13.     UINT    place, ret_val
  14.     LOGICAL going, first
  15.   ENDDEF
  16.  
  17.   ret_val = 0
  18.  
  19.   place = current_col - 1
  20.   IF place = 0
  21.     RETURN ret_val
  22.   ENDIF
  23.  
  24.   IF full_byte[ place-1 ] = 32 .OR. full_byte[ place-1 ] = 9
  25.     first = .F.
  26.   ELSE
  27.     first = .T.
  28.   ENDIF
  29.  
  30.   DO WHILE going
  31.     place = place - 1
  32.     IF first
  33.       IF ( full_byte[ place ] = 32 .OR. full_byte[ place ] = 9 )
  34.       * we are at the start of a word, that is all
  35.         ret_val     = 1
  36.         going       = .F.
  37.         current_col = place + 2  && get back to the actual start character
  38.         LOOP
  39.       ELSE
  40.         IF place = 0
  41.           ret_val     = 1
  42.           current_col = 1
  43.           going       = .F.
  44.           LOOP
  45.         ENDIF
  46.  
  47.       ENDIF
  48.  
  49.     ELSE
  50.     * go until the last character of a word
  51.       IF ( full_byte[ place ] <> 32 .AND. full_byte[ place ] <> 9 )
  52.         first = .T.
  53.         LOOP
  54.       ELSE
  55.         IF place = 0
  56.           current_col = 1
  57.           ret_val     = 0
  58.           going       = .F.
  59.           LOOP
  60.         ENDIF
  61.  
  62.       ENDIF
  63.  
  64.     ENDIF
  65.  
  66.   ENDDO
  67.  
  68.   RETURN ret_val
  69. ENDPRO