procedure eve_flush(pattern_string) ! Flush all lines containing pattern string local the_arg, lowercase_arg, ! All lowercase version of pattern_string how_exact, ! Controls exact/no_exact search first_flag; ! T/F flag to check if first search fails ! Code to handle null parameter and prompt for it the_arg := pattern_string; first_flag := 1; if (the_arg = '') then the_arg := read_line('Flush lines containing: '); endif; if the_arg = '' then message("Nothing specified to flush"); return; endif; lowercase_arg := the_arg; change_case(lowercase_arg,lower); ! If arg is all lowercase, do NO_EXACT search ! If arg has any uppercase, do EXACT search ! If arg enclosed in ~~ then do exact search regardless of case how_exact := EXACT; if the_arg = lowercase_arg then how_exact := NO_EXACT; endif; if substr(the_arg,1,1) = '~' then how_exact := EXACT; ! Remove trailing, leading ~ characters the_arg := substr(the_arg, 1, length(the_arg)-1); the_arg := substr(the_arg, 2, length(the_arg)-1); endif; position(beginning_of(current_buffer)); loop; exitif mark(none) = end_of(current_buffer); a_loc := search(the_arg,FORWARD,how_exact); exitif a_loc = 0; first_flag := 0; position(beginning_of(a_loc)); move_horizontal(-current_offset); erase_line; endloop; if first_flag then message("Nothing to flush"); else message("Flush complete"); endif; endprocedure; procedure tpu$local_init ! Initialization eve$arg1_flush := eve$arg1_buffer; endprocedure;