! ! ***** MOVE TO THE NEXT WORD ***** ! PROCEDURE fred$move_word if CURRENT_DIRECTION = forward then fred$move_word_f; else fred$move_word_r; ! Moveback endif; ENDPROCEDURE; ! ! ! ***** DELETE TO END OF WORD ***** ! PROCEDURE fred$delete_end_word LOCAL temp_length ; temp_length := fred$end_word; if temp_length = 0 then ! Then we are on EOL fred$x_deleted_word:=ASCII(10); ! Line feed if MARK(none) <> END_OF (CURRENT_BUFFER) then MOVE_HORIZONTAL(1); if MARK(none) <> END_OF (CURRENT_BUFFER) then APPEND_LINE; ! Join both lines else MOVE_HORIZONTAL (-1); endif; endif; else fred$x_deleted_word := ERASE_CHARACTER(- temp_length) ! Delete the word endif; ENDPROCEDURE; ! ! ! ***** UNDELETE WORD ***** ! PROCEDURE fred$undelete_word !gold keypad minus(undelete word) LOCAL two_lines; if fred$x_deleted_word <> ASCII(10) then if SUBSTR (fred$x_deleted_word, 1, 1) = ASCII(10) then SPLIT_LINE; COPY_TEXT (SUBSTR(fred$x_deleted_word, 2, LENGTH(fred$x_deleted_word) - 1)); else COPY_TEXT (fred$x_deleted_word) ; endif; MOVE_HORIZONTAL( - LENGTH (fred$x_deleted_word)); else SPLIT_LINE; MOVE_HORIZONTAL (-1); endif; ENDPROCEDURE; ! ! ! ***** MOVE BACKWARDS A WORD ***** ! PROCEDURE fred$move_word_r ! Support routine for move word (reverse) if fred$beg_word = 0 then ! Move to beginning of word, back a line if none MOVE_HORIZONTAL(-1); endif; ENDPROCEDURE; ! ! ! ***** MOVE FORWARDS A WORD ***** ! PROCEDURE fred$move_word_f ! Support routine for move word (forward) if fred$end_word = 0 then MOVE_HORIZONTAL(1); endif; ENDPROCEDURE; ! ! ! ***** DELETE TO BEGINNING OF WORD ***** ! PROCEDURE fred$del_beg_word ! Support routine for delete word (forward) LOCAL temp_length ; temp_length := fred$beg_word; ! Go to beginning of word if temp_length = 0 then if MARK (none) = END_OF (CURRENT_BUFFER) then MOVE_HORIZONTAL (-1); else APPEND_LINE; endif; fred$x_deleted_word := ASCII(10); else fred$x_deleted_word := ERASE_CHARACTER (temp_length) endif; ENDPROCEDURE; ! ! ! ***** FIND THE BEGINNING OF WORD ***** ! PROCEDURE fred$beg_word ! Support routine for move word LOCAL temp_char, temp_length; if CURRENT_OFFSET = 0 then RETURN (0); endif; MOVE_HORIZONTAL (-1); ! Skip current character temp_length := 1; ! ! Count any spaces ! temp_char := CURRENT_CHARACTER; loop exitif CURRENT_OFFSET = 0; exitif temp_char <> ' '; MOVE_HORIZONTAL (-1); temp_length := temp_length + 1; temp_char := CURRENT_CHARACTER; endloop; ! ! IF we are on a word terminator count that one character. Otherwise ! scan to the next word terminator. ! if (INDEX (fred$x_word,temp_char) = 0) then loop exitif current_offset = 0; move_horizontal(-1); temp_char := current_character; if (index(fred$x_word,temp_char) <> 0) then move_horizontal(1); exitif ; endif; temp_length := temp_length + 1; endloop; endif; return temp_length; endprocedure ! ! ! ***** FIND THE END OF THE WORD ***** ! PROCEDURE fred$end_word !support routine for delete word LOCAL temp_range , temp_length ; on_error ! catch search failure (suppress message) return temp_length ! return 0 endon_error temp_range := search (fred$x_forward_word,forward); temp_length := length(temp_range); move_horizontal(temp_length); return temp_length; ENDPROCEDURE; PROCEDURE fred$swap_word_delimiters if INDEX (fred$x_word,"/") = 0 then ! Toggle word delimiters fred$x_word := fred$x_word_delim2; ! Line is SPACE, TAB, FF, LF, CR, VT /<>[]{},.:*&!;+-=^()\|?_$' MESSAGE ("Current word delimiters: SPACE TAB FF LF CR VT /<>[]{},.:*&!;+-=^()""\|?_$'"); else fred$x_word := fred$x_word_delim1; ! Line is SPACE, TAB, FF, LF, CR, VT MESSAGE ("Current word delimiters: SPACE TAB FF LF CR VT"); endif; eve$update_status_lines; ENDPROCEDURE;