home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / FOXPRO / VEDIT060 / SOURCE / VEDIT4.PRG < prev    next >
Text File  |  1992-03-23  |  1KB  |  73 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_Forward_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.     INT     eol
  15.     LOGICAL going, first
  16.   ENDDEF
  17.  
  18.   eol = LEN( temp_str ) - 1
  19.   ret_val = 0
  20.  
  21.   IF eol = 0
  22.     current_col = current_col + 1
  23.     RETURN 0
  24.   ENDIF
  25.  
  26.   place = current_col - 1
  27.   IF full_byte[ place ] = 32 .OR. full_byte[ place ] = 9
  28.     first = .T.
  29.   ELSE
  30.     first = .F.
  31.   ENDIF
  32.  
  33.   DO WHILE going
  34.     place = place + 1
  35.     IF first
  36.       IF ( full_byte[ place ] <> 32 .AND. full_byte[ place ] <> 9 )
  37.       * we are at the start of a word, end this sucker
  38.         ret_val     = 1
  39.         going       = .F.
  40.         current_col = place + 1
  41.         LOOP
  42.       ELSE
  43.         IF place >= eol
  44.           ret_val     = 0
  45.           current_col = place + 1
  46.           going       = .F.
  47.           LOOP
  48.         ENDIF
  49.  
  50.       ENDIF
  51.  
  52.     ELSE
  53.     * go until the end of a word, then switch to going until the start
  54.       * of a word...
  55.       IF ( full_byte[ place ] = 32 .OR. full_byte[ place ] = 9 )
  56.         first = .T.
  57.         LOOP
  58.       ELSE
  59.         IF place >= eol
  60.           current_col = place + 1
  61.           ret_val     = 0
  62.           going       = .F.
  63.           LOOP
  64.         ENDIF
  65.  
  66.       ENDIF
  67.  
  68.     ENDIF
  69.  
  70.   ENDDO
  71.  
  72.   RETURN ret_val
  73. ENDPRO