procedure tpu$local_init eve$arg1_occurs := eve$arg1_buffer; endprocedure; procedure eve_occurs(the_arg) ! list lines containing a string local the_buffer, ! the buffer being searched the_position, ! position in search buffer the_target, ! string to be located and listed the_line, ! line containing the text occurance_start, ! Offsets of found string in line occurance_end, temp; ! used to build the record count as a string the_target := the_arg; if (the_arg = '') then the_target := read_line('occurances of: '); endif; the_buffer := current_buffer; ! remember where we were. the_position := mark(none); if (the_target = '') then return; else eve_buffer("occurs buffer"); set(system, current_buffer); set(no_write, current_buffer); erase(current_buffer); outbuf := current_buffer; ! save name of this buf message("searching for string..."); position(beginning_of(the_buffer)); loop a_match := search(the_target,forward); exitif a_match = 0; ! no more matches position(a_match); occurance_start := current_offset; position(end_of(a_match)); occurance_end := current_offset; the_line := current_line; position(outbuf); copy_text(the_line); move_horizontal(-current_offset + occurance_start); copy_text("{"); move_horizontal(-current_offset + occurance_end +2); copy_text("}"); move_horizontal(-current_offset); move_vertical(1); position(end_of(a_match)); if length(the_target) = 1 then move_horizontal(1); endif; endloop; position(outbuf); endif; message(" "); update(current_window); temp := read_line("press return to go back to your buffer"); temp := get_info(the_buffer,"name"); eve_buffer(temp); position(the_position); endprocedure;