! ! ! ***** GOTO LINE ***** ! ! Go to start of a certain line in the current buffer ! ! Parameters: ! ! line_parameter Line number to move to - input ! ! Modified to allow going to the previous line that was specified... ! ! PROCEDURE fred$goto_line LOCAL line_number, ! Line # to go to this_position, ! Marker for current cursor position read_line_string, ! String read after prompt start_key, next_key, last_line; ! Number of lines in buffer, including eob_text on_error MESSAGE (FAO ("Cannot move to line !SL", line_number)); POSITION (this_position); RETURN; endon_error; start_key := eve$lookup_comment (LAST_KEY); line_number := READ_LINE ("Line number: ",4); ! Only four characters if start_key = ret_key then ! are read because RETURN; ! READ_LINE will not endif; ! terminate when F14 this_position := MARK (none); ! is hit... next_key := eve$lookup_comment (LAST_KEY); eve$cleanse_string (line_number); line_number := INT (line_number); if line_number = 0 then if next_key = "goto_line" then if fred$x_last_gotoline = 0 then MESSAGE ("No previous line to go to..."); RETURN; else line_number := fred$x_last_gotoline; MESSAGE (FAO ("Going to previous line: !SL",line_number)); endif; else MESSAGE ("No line number to move to..."); POSITION (this_position); RETURN; endif; endif; last_line := GET_INFO (CURRENT_BUFFER, eve$kt_record_count) + 1; ! Include eob_text if line_number > last_line then if last_line > 0 then MESSAGE (FAO ("Buffer has only !SL line!%S", last_line)); else MESSAGE ("Buffer is empty"); endif; else POSITION (BEGINNING_OF (CURRENT_BUFFER)); MOVE_VERTICAL (line_number - 1); ! Already at line 1 eve$position_in_middle (MARK (none)); endif; fred$x_last_gotoline := line_number; MESSAGE (""); ENDPROCEDURE; PROCEDURE tpu$local_init fred$x_line := 0; ENDPROCEDURE;