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 >
Wrap
Text File
|
1992-03-23
|
1KB
|
69 lines
#INCLUDE KEYS.HDR
#INCLUDE vlist.hdr
#INCLUDE vmouse.hdr
#INCLUDE vedit.hdr
#INCLUDE STRING.HDR
FUNCTION UINT VEdit_Backward_Space
PARAMETERS CHAR temp_str,;
UINT current_col
VARDEF
BYTE full_byte[ 250 ] based temp_str
UINT place, ret_val
LOGICAL going, first
ENDDEF
ret_val = 0
place = current_col - 1
IF place = 0
RETURN ret_val
ENDIF
IF full_byte[ place-1 ] = 32 .OR. full_byte[ place-1 ] = 9
first = .F.
ELSE
first = .T.
ENDIF
DO WHILE going
place = place - 1
IF first
IF ( full_byte[ place ] = 32 .OR. full_byte[ place ] = 9 )
* we are at the start of a word, that is all
ret_val = 1
going = .F.
current_col = place + 2 && get back to the actual start character
LOOP
ELSE
IF place = 0
ret_val = 1
current_col = 1
going = .F.
LOOP
ENDIF
ENDIF
ELSE
* go until the last character of a word
IF ( full_byte[ place ] <> 32 .AND. full_byte[ place ] <> 9 )
first = .T.
LOOP
ELSE
IF place = 0
current_col = 1
ret_val = 0
going = .F.
LOOP
ENDIF
ENDIF
ENDIF
ENDDO
RETURN ret_val
ENDPRO