!==========================================================================! !--- My Editor EDT Keypad Definitions ---------------- Version 0 Mod 00 ---! !==========================================================================! !--------------------------------------------------------------------------! !--- These routines were taken from the DECUS VAX SIG Tape Spring 87 ------! !--- and were written by: -------------------------------------------------! !--------------------------------------------------------------------------! !----------------------- Scott E. Smith -----------------------------------! !----------------------- Sperry Marine Inc. -------------------------------! !----------------------- Charlottesville, VA 22906 -----------------------! !----------------------- (804) 973-0186 -----------------------------------! !--------------------------------------------------------------------------! !--- They were extracted from his editor and modified so that they can ----! !--- added to my eXtended EVE editor. Several users like and requested ---! !--- the EDT keypad functions. --------------------------------------------! !--------------------------------------------------------------------------! !--- To add the EDT keypad to XEVE, edit this file with XEVE and enter ----! !--- the following DO commands: -------------------------------------------! !--------------------------------------------------------------------------! !------- Command: EXTEND TPU * --------------------------------------------! !------- Command: SAVE EXTENDED TPU EDT_EDITOR ----------------------------! !------- Command: QUIT ----------------------------------------------------! !--------------------------------------------------------------------------! !--- The TPU section EDT_EDITOR.TPU$SECTION now contains the EDT ----------! !--- keypad definitions. --------------------------------------------------! !--------------------------------------------------------------------------! !==========================================================================! !--------------------------------------------------------------------------- ! Define An EDT Keypad !--------------------------------------------------------------------------- procedure my_editor_define_edt_keypad ! flags restoring word across line bound eve$x_edt_word_restoring_line := 0; ! flags restoring char across line bound eve$x_edt_character_restoring_line := 0; ! flags restoring line across line bound eve$x_edt_line_restoring_line := 0; ! last line deleted by edt_erase_line eve$x_edt_deleted_line := ''; ! last word deleted by edt_erase_word eve$x_edt_deleted_word := ''; ! last char deleted by edt_erase_character eve$x_edt_deleted_character := ''; ! variables for the substitute command eve$arg1_substitute := eve$arg1_buffer; eve$arg2_substitute := eve$arg1_buffer; eve$arg3_substitute := eve$arg1_buffer; eve$arg4_substitute := eve$arg1_buffer; eve$arg5_substitute := eve$arg1_buffer; eve$x_edt_subs_temp := eve$x_null; eve$x_edt_subs_target := eve$x_null; eve$x_edt_subs_replacement := eve$x_null; ! define EDT key pad keys set (shift_key,PF1); define_key ('eve_help("EDT_KEYPAD")', PF2); define_key ('eve_help("")', key_name(PF2,shift_key)); define_key ('eve_edt_find_next', PF3); define_key ('eve_find ("")', key_name(PF3,shift_key)); define_key ('eve_edt_erase_line', PF4); define_key ('eve_edt_restore_line', key_name(PF4,shift_key)); ! define_key ('eve_edt_page', KP7); define_key ('eve_do("")', key_name(KP7,shift_key)); define_key ('eve_edt_screen', KP8); define_key ('eve_edt_fill', key_name(KP8,shift_key)); define_key ('eve_edt_append', KP9); define_key ('eve_edt_replace_range', key_name(KP9,shift_key)); define_key ('eve_edt_erase_word', MINUS); define_key ('eve_edt_restore_word', key_name(MINUS,shift_key)); ! define_key ('eve_forward', KP4); define_key ('eve_bottom', key_name(KP4,shift_key)); define_key ('eve_reverse', KP5); define_key ('eve_top', key_name(KP5,shift_key)); define_key ('eve_remove', KP6); define_key ('eve_insert_here', key_name(KP6,shift_key)); define_key ('eve_edt_erase_character', COMMA); define_key ('eve_edt_restore_character', key_name(COMMA,shift_key)); ! define_key ('eve_move_by_word', KP1); define_key ('eve_edt_change_case', key_name(KP1,shift_key)); define_key ('eve_edt_end_of_line', KP2); define_key ('eve_edt_erase_end_of_line', key_name(KP2,shift_key)); define_key ('eve_edt_move_by_character', KP3); define_key ('eve_edt_special_insert', key_name(KP3,shift_key)); ! define_key ('eve_edt_start_of_line', KP0); define_key ('eve_edt_open_line', key_name(KP0,shift_key)); define_key ('eve_select', PERIOD); define_key ('eve_edt_reset', key_name (PERIOD,shift_key)); define_key ('eve_return', ENTER); define_key ('eve_edt_substitute', key_name(ENTER,shift_key)); ! define other keys define_key('eve_define_key("")', CTRL_K_KEY); define_key ('eve_edt_margin_compute', key_name('a',shift_key)); define_key ('eve_edt_margin_decrement', key_name('d',shift_key)); define_key ('eve_edt_margin_increment', key_name('e',shift_key)); define_key ('eve_insert_mode', key_name('I',shift_key)); define_key ('eve_overstrike_mode', key_name('O',shift_key)); ! key definitions currently not defined (used) !define_key('eve_edt_margin_compute', CTRL_A_KEY); !define_key('eve_edt_margin_decrement', CTRL_D_KEY); !define_key('eve_edt_margin_increment', CTRL_E_KEY); !define_key('eve_edt_erase_previous_word', CTRL_J_KEY); !define_key('copy_text(ascii(12));', CTRL_L_KEY); !define_key ('eve_change_mode', key_name('P',shift_key)); !define_key('eve_edt_erase_start_of_line', CTRL_U_KEY); !define_key('eve_previous_screen', key_name(UP,shift_key)); !define_key('eve_next_screen', key_name(DOWN,shift_key)); endprocedure; !--------------------------------------------------------------------------- ! Find the next occurence of the target of the last EVE_FIND command ! PF3 (find next) !--------------------------------------------------------------------------- procedure eve_edt_find_next if eve$x_target = eve$x_null then message ("No previous target to find"); return (0); else eve$find (eve$x_target,0); endif; endprocedure !--------------------------------------------------------------------------- ! ! GOLD/ENTER !--------------------------------------------------------------------------- procedure eve_edt_substitute local new_target, ! Local copy of target lowercase_target, ! Lowercase version of eve$x_target this_position, ! Marker for current cursor position how_exact, ! Keyword to indicate case-sensitivity find_range; ! Range returned by search on_error if error = tpu$_strnotfound then find_range := 0; endif; endon_error; if eve$x_target = eve$kt_null then message ("No previous target to find"); return (0); endif; lowercase_target := eve$x_target; if get_info (lowercase_target, eve$kt_type) = string then change_case (lowercase_target, lower); endif; if lowercase_target = eve$x_target then how_exact := no_exact; else how_exact := exact; endif; this_position := mark (none); find_range := search (eve$x_target, forward, how_exact); if find_range = 0 then message ('No select range active'); return (0); endif; if this_position = beginning_of (find_range) then position (find_range); erase (find_range); eve_insert_here; else message ('No select range active'); find_range := 0; return (0); endif; if current_direction = forward then if this_position <> end_of (current_buffer) then find_range := search (eve$x_target, forward, how_exact); else find_range := 0; endif; else if this_position <> beginning_of (current_buffer) then move_horizontal (-1); find_range := search (eve$x_target, reverse, how_exact); else find_range := 0; endif; endif; if find_range = 0 then if get_info (eve$x_target, eve$kt_type) = string then message (fao ("Could not find: !AS", eve$x_target)); else message ("Could not find: "); endif; position (this_position); else position (find_range); endif; endprocedure; !--------------------------------------------------------------------------- ! Erase the rest of line and save the deleted text in a special buffer ! PF4 (erase line) !--------------------------------------------------------------------------- procedure eve_edt_erase_line eve_erase_line; eve$x_edt_deleted_line := eve$x_restore_text; eve$x_edt_line_restoring_line := eve$x_restoring_line; endprocedure !--------------------------------------------------------------------------- ! Erase to start of line and save the deleted text in a special buffer ! CTRL/U (erase start of line) !--------------------------------------------------------------------------- procedure eve_edt_erase_start_of_line eve_erase_start_of_line; eve$x_edt_deleted_line := eve$x_restore_text; eve$x_edt_line_restoring_line := eve$x_restoring_line; endprocedure !--------------------------------------------------------------------------- ! Erase to end of line (but not the terminator) -- store deleted text in ! special buffer ! KP2 (erase end of line) !--------------------------------------------------------------------------- procedure eve_edt_erase_end_of_line local this_position; ! Marker for current cursor position this_position := mark (none); if this_position = end_of (current_buffer) then return; else if current_character = eve$x_null then eve$x_restoring_line := 1; move_horizontal (1); if mark (none) = end_of (current_buffer) then move_horizontal (-1); eve$x_restore_text := eve$x_null; else eve$x_restore_text := erase_line; endif; else eve$x_restoring_line := 0; eve$x_restore_text := erase_character (length (current_line)); endif; endif; eve$x_edt_deleted_line := eve$x_restore_text; eve$x_edt_line_restoring_line := eve$x_restoring_line; endprocedure; !--------------------------------------------------------------------------- ! Erase word and store the deleted text in a seperate buffer ! Linefeed (ctrl/j) !--------------------------------------------------------------------------- procedure eve_edt_erase_previous_word eve_erase_previous_word; eve$x_edt_deleted_word := eve$x_restore_text; eve$x_edt_word_restoring_line := eve$x_restoring_line; endprocedure !--------------------------------------------------------------------------- ! Erase word and store the deleted text in a seperate buffer ! Minus (delete word) !--------------------------------------------------------------------------- procedure eve_edt_erase_word eve_erase_word; eve$x_edt_deleted_word := eve$x_restore_text; eve$x_edt_word_restoring_line := eve$x_restoring_line; endprocedure !--------------------------------------------------------------------------- ! Restore text from the deleted line buffer ! GOLD/PF4 (undelete line) !--------------------------------------------------------------------------- procedure eve_edt_restore_line local save_restore_text, save_restoring_line; save_restore_text := eve$x_restore_text; save_restoring_line := eve$x_restoring_line; eve$x_restore_text := eve$x_edt_deleted_line; eve$x_restoring_line := eve$x_edt_line_restoring_line; eve_restore; eve$x_restore_text := save_restore_text; eve$x_restoring_line := save_restoring_line; endprocedure !--------------------------------------------------------------------------- ! Restore text from the special delete word buffer ! GOLD/MINUS (undelete word) !--------------------------------------------------------------------------- procedure eve_edt_restore_word local save_restore_text, save_restoring_line; save_restore_text := eve$x_restore_text; save_restoring_line := eve$x_restoring_line; eve$x_restore_text := eve$x_edt_deleted_word; eve$x_restoring_line := eve$x_edt_word_restoring_line; eve_restore; eve$x_restore_text := save_restore_text; eve$x_restoring_line := save_restoring_line; endprocedure !--------------------------------------------------------------------------- ! Erase text and store in a special buffer -- behavior depends on current ! mode ! KEYPAD COMMA (erase chracter) !--------------------------------------------------------------------------- procedure eve_edt_erase_character local this_position; ! Marker for current cursor position this_position := mark (none); if this_position = end_of (current_buffer) then return; else if current_character = eve$x_null then eve$x_edt_deleted_character := eve$x_null; eve$x_edt_character_restoring_line := 1; move_horizontal (1); if mark (none) = end_of (current_buffer) then move_horizontal (-1); else eve$append_line; endif; else eve$x_edt_deleted_character := current_character; eve$x_edt_character_restoring_line := 0; if get_info (current_buffer, "mode") = overstrike then copy_text (" "); else erase_character (1); endif; endif; endif; endprocedure; !--------------------------------------------------------------------------- ! Restore text from the deleted character buffer -- behavior depend ! on current mode ! GOLD/COMMA (undelete character) !--------------------------------------------------------------------------- procedure eve_edt_restore_character local save_restore_text, save_restoring_line; if (get_info (current_buffer, "mode") = overstrike) and (current_offset > 0) and (not eve$x_edt_character_restoring_line) then move_horizontal (-1); copy_text (eve$x_edt_deleted_character); else save_restore_text := eve$x_restore_text; save_restoring_line := eve$x_restoring_line; eve$x_restore_text := eve$x_edt_deleted_character; eve$x_restoring_line := eve$x_edt_character_restoring_line; eve_restore; eve$x_restore_text := save_restore_text; eve$x_restoring_line := save_restoring_line; endif; endprocedure !--------------------------------------------------------------------------- ! KP7 (page) !--------------------------------------------------------------------------- procedure eve_edt_page LOCAL dir, next_page ; on_error if error = tpu$_strnotfound then if dir = REVERSE then position(beginning_of(current_buffer)) else position(end_of(current_buffer)) endif; endif; return endon_error dir := current_direction; if dir = FORWARD then move_horizontal(1) else move_horizontal(-1) endif; next_page := search(ascii(12),dir); position(beginning_of(next_page)); endprocedure; !--------------------------------------------------------------------------- ! Scroll a screenful of text in the if current_direction = forward ! current direction ! KP8 (screen) !--------------------------------------------------------------------------- procedure eve_edt_screen if current_direction = forward then eve$move_by_screen (1) else eve$move_by_screen (-1) endif; endprocedure !--------------------------------------------------------------------------- ! Append the select region to the insert here buffer ! KP9 (append) !--------------------------------------------------------------------------- procedure eve_edt_append local this_position, ! Marker for current cursor position remove_range; ! Range being removed this_position := mark (none); if eve$x_select_position <> 0 then if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Append must be used in the same buffer as Select."); else remove_range := select_range; ! Select & Remove in same spot => erase this character if remove_range = 0 then if this_position = end_of (current_buffer) then message ("Nothing to append"); eve$x_select_position := 0; return; else remove_range := create_range (mark (none), mark (none), none); endif; endif; position (end_of(paste_buffer)); move_horizontal (-1); move_text (remove_range); position (this_position); eve$x_select_position := 0; remove_range := 0; message ("Append completed."); endif; else message ("Use Select before using Append."); endif; endprocedure; !--------------------------------------------------------------------------- ! Replace selected range with insert here buffer ! GOLD/KP9 (replace range) !--------------------------------------------------------------------------- procedure eve_edt_replace_range local this_position, ! Marker for current cursor position remove_range; ! Range being removed this_position := mark (none); if eve$x_select_position <> 0 then if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Replace must be used in the same buffer as Select."); else remove_range := select_range; ! Select & Remove in same spot => erase this character if remove_range = 0 then if this_position = end_of (current_buffer) then message ("Nothing to remove"); eve$x_select_position := 0; return; else remove_range := create_range (mark (none), mark (none), none); endif; endif; erase (remove_range); eve$x_select_position := 0; remove_range := 0; eve_insert_here; message ("Replace completed."); endif; else message ("Use Select before using Replace."); endif; endprocedure; !--------------------------------------------------------------------------- ! change case of all characters in the select region ! GOLD/KP1 (change case) !--------------------------------------------------------------------------- procedure eve_edt_change_case local change_range, ! Range being changed character; ! Temporary stoage if eve$x_select_position <> 0 then if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Change Case must be used in the same buffer as Select."); else change_range := select_range; ! Select & Change in same spot => change case this character if change_range = 0 then if mark (none) = end_of (current_buffer) then eve$x_select_position := 0; return; else change_range := create_range (mark (none), mark (none), none); endif; endif; change_case(change_range, invert); eve$x_select_position := 0; change_range := 0; endif; else !change case of current character if current_character <> eve$x_null then character :=current_character; change_case(character,invert); if (get_info (current_buffer, "mode") = insert) then erase_character(1) endif; copy_text(character); if current_direction <> forward then move_horizontal(-2); endif; return endif; endif; endprocedure; !--------------------------------------------------------------------------- ! Fill the select region or current paragraph if no select region is active ! GOLD/KP7 (fill) !--------------------------------------------------------------------------- procedure eve_edt_fill local fill_range, ! Range being filled character; ! Temporary stoage on_error fill_range := 0; set (screen_update, on); endon_error; if eve$x_select_position <> 0 then if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Fill must be used in the same buffer as Select."); else fill_range := select_range; if fill_range = 0 then message ("Nothing to fill"); return (0); endif; set (screen_update, off); fill (fill_range, eve$x_fill_separators); eve$show_first_line; eve$x_select_position := 0; fill_range := 0; set (screen_update, on); endif; else !fill paragraph eve_fill_paragraph; endif; endprocedure; !--------------------------------------------------------------------------- ! Move the next End of Line ! KP2 (end of line) !--------------------------------------------------------------------------- procedure eve_edt_end_of_line if current_direction = forward then if mark(none) <> end_of (current_buffer) then if current_offset = length (current_line) then move_vertical(1) endif; ! move back if mark(none) <> end_of(current_buffer) then move_horizontal(length(current_line)-current_offset); ! goto EOL endif; endif else move_horizontal(( - current_offset)+(-1)) endif; endprocedure ! end of EOL !--------------------------------------------------------------------------- ! move one character in the current direction ! KP3 (move by character) !--------------------------------------------------------------------------- procedure eve_edt_move_by_character if current_direction = forward then move_horizontal(1) else move_horizontal(-1) endif; endprocedure !--------------------------------------------------------------------------- ! Insert character with specified value ! GOLD/KP3 (special insert) !--------------------------------------------------------------------------- procedure eve_edt_special_insert copy_text(ascii(int(read_line("Decimal value of character: ")))); endprocedure !--------------------------------------------------------------------------- ! Open a new line at the cursor position ! GOLD/KP0 (open line) !--------------------------------------------------------------------------- procedure eve_edt_open_line split_line; move_horizontal (-1); endprocedure !--------------------------------------------------------------------------- ! Move in the current direction to the start of the next line ! KP0 (start of line) !--------------------------------------------------------------------------- procedure eve_edt_start_of_line LOCAL o; ! edt equiv. of Keypad 0 o := current_offset; move_horizontal(- o); if current_direction = forward then move_vertical(1) else if o = 0 then move_vertical(-1) endif; endif; endprocedure !--------------------------------------------------------------------------- ! Reset the current select range ! GOLD/PERIOD (reset) !--------------------------------------------------------------------------- procedure eve_edt_reset eve$x_select_position := 0; message ("Selection cancelled."); endprocedure !--------------------------------------------------------------------------- ! Compute Left Margin ! CTRL/A key !--------------------------------------------------------------------------- procedure eve_edt_margin_compute eve_set_left_margin((((current_offset / 4) * 4) + 1)); endprocedure !--------------------------------------------------------------------------- ! Decrease left Margin ! CTRL/A key !--------------------------------------------------------------------------- procedure eve_edt_margin_decrement eve_set_left_margin(get_info(current_buffer,eve$kt_left_margin)-4); endprocedure !--------------------------------------------------------------------------- ! Increase Left Margin ! CTRL/E key !--------------------------------------------------------------------------- procedure eve_edt_margin_increment eve_set_left_margin(get_info(current_buffer,eve$kt_left_margin)+4); endprocedure !--------------------------------------------------------------------------- ! Search and replace procedure. Case-sensitivity of search is same as ! for the find command. If case-insensitive, replacements are done to ! match case of current occurrence. ! ! Parameters: ! ! substitute_parameter_1 Old string - input ! substitute_parameter_2 New string - input ! substitute_parameter_3 Range - input ! substitute_parameter_4 start substitute column - input (default 1) ! substitute_parameter_5 end substitute column - input ! (default eve$x_larget_width) ! ! The range parameter may be: ! ! "one" - (default) Replace only the next occurrence in the ! current_direction. ! "rest" - Replace all occurrences between the current position and ! the end of buffer in the current direction. Return the ! cursor to its starting postion. ! "all" - Replace occurrences and return cursor its current position. ! "select" - Replace all occurrences in the current select range and ! return the cursor to its current position. !--------------------------------------------------------------------------- procedure eve_substitute (substitute_parameter_1, substitute_parameter_2, substitute_parameter_3, substitute_parameter_4, substitute_parameter_5) local this_buffer, ! Current buffer this_position, start_marker, end_marker, range_parameter, selected_range, direction, once_only, null_parameters, start_column, end_column, this_mode, ! Keyword for current mode lowercase_target, ! Lowercase version of target string lowercase_replacement, ! Lowercase version of replacement string uppercase_target, ! Uppercase version of target string uppercase_replacement, ! Uppercase version of replacement string capital_target, ! Capitalized version of target string capital_replacement, ! Capitalized version of replacement string how_exact, ! Keyword to indicate case-sensitivity replace_range, ! Range of current occurrence range_length, ! Length of replace_action this_occurrence, ! String of replace_range occurrences; ! Number of replacements made so far this_position := mark (none); this_buffer := current_buffer; this_mode := get_info (current_buffer, "mode"); set (insert, this_buffer); if substitute_parameter_1 = eve$x_null then null_parameters := 1; else eve$x_edt_subs_temp := substitute_parameter_1; null_parameters := 0; endif; if not (eve$prompt_string (eve$x_edt_subs_temp, eve$x_edt_subs_target, "Old string: ", "No string to replace")) then return; endif; if null_parameters then eve$x_edt_subs_replacement := read_line ("New string: "); ! empty string is ok here else eve$x_edt_subs_replacement := substitute_parameter_2; endif; range_parameter := substitute_parameter_3; if get_info (range_parameter, "type") = string then change_case (range_parameter, lower); endif; once_only := 0; if range_parameter = eve$x_null then range_length := 0; else range_length := length (range_parameter); endif; if (range_length = 0) or (range_parameter = substr ("one", 1, range_length)) then once_only := 1; start_marker := mark (none); end_marker := end_of (current_buffer); direction := current_direction; else if range_parameter = substr ("all", 1, range_length) then start_marker := beginning_of (current_buffer); end_marker := end_of (current_buffer); direction := forward; else if range_parameter = substr ("rest", 1, range_length) then start_marker := mark (none); end_marker := end_of (current_buffer); direction := current_direction; else if range_parameter = substr ("select", 1, range_length) then if eve$x_select_position <> 0 then if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Substitute must be used in the same buffer as Select."); else selected_range := select_range; eve$x_select_position := 0; start_marker := beginning_of (selected_range); end_marker := end_of (selected_range); direction := forward; endif; else message ("Use Select before using Substitute."); return; endif; else message ("Invalid range specification, "+range_parameter); return; endif; endif; endif; endif; start_column := substitute_parameter_4; if get_info(start_column, eve$kt_type) = string then if start_column = "" then start_column := 0; else translate (start_column, "1", "l"); start_column := int(start_column) - 1; endif; endif; end_column := substitute_parameter_5; if get_info(end_column, eve$kt_type) = string then if end_column = "" then end_column := eve$x_largest_width - 1; else translate (end_column, "1", "l"); end_column := int(end_column) - 1; endif; endif; lowercase_target := eve$x_edt_subs_target; if get_info (lowercase_target, "type") = string then change_case (lowercase_target, lower); endif; lowercase_replacement := eve$x_edt_subs_replacement; change_case (lowercase_replacement, lower); if (lowercase_target = eve$x_edt_subs_target) and (lowercase_replacement = eve$x_edt_subs_replacement) then how_exact := no_exact; uppercase_target := eve$x_edt_subs_target; if get_info (uppercase_target, "type") = string then change_case (uppercase_target, upper); endif; capital_target := eve$x_edt_subs_target; if get_info (capital_target, "type") = string then eve$capitalize_string (capital_target); endif; uppercase_replacement := eve$x_edt_subs_replacement; change_case (uppercase_replacement, upper); capital_replacement := eve$x_edt_subs_replacement; eve$capitalize_string (capital_replacement); else how_exact := exact; endif; set (screen_update, off); position (start_marker); loop replace_range := search (eve$x_edt_subs_target, direction, how_exact); exitif replace_range = 0; position (replace_range); if (start_column <= current_offset) and (current_offset <= end_column) then exitif mark (none) >= end_marker; this_occurrence := erase_character (length (replace_range)); if how_exact = exact then copy_text (eve$x_edt_subs_replacement); else ! Make sure non-alphabetic target is replaced by lowercas if this_occurrence = lowercase_target then copy_text (lowercase_replacement); else if this_occurrence = uppercase_target then copy_text (uppercase_replacement); else if this_occurrence = capital_target then copy_text (capital_replacement); else copy_text (lowercase_replacement); endif; endif; endif; endif; if direction = reverse then move_horizontal (- (length (eve$x_edt_subs_replacement)+1)); endif; occurrences := occurrences + 1; exitif once_only; else if direction = reverse then move_horizontal (-1); else move_horizontal (+1); endif; endif; endloop; if not once_only then position (this_position); endif; set (screen_update, on); message (fao ("Replaced !SL occurrence!%S", occurrences)); set (this_mode, this_buffer); endprocedure;