Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!eg.ti.COM!BOLTHOUSE%MCOPN1 From: BOLTHOUSE%MCOPN1@eg.ti.COM.UUCP Newsgroups: comp.os.vms Subject: RE: Line numbers in EVE. Message-ID: <8706090317.AA28863@ucbvax.Berkeley.EDU> Date: Mon, 8-Jun-87 10:39:00 EDT Article-I.D.: ucbvax.8706090317.AA28863 Posted: Mon Jun 8 10:39:00 1987 Date-Received: Thu, 11-Jun-87 05:29:48 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 69 I can't help you with vanilla EVE. But you can add this to your own section file... This comes with EVEPLUS, by the way. David L. Bolthouse Texas Instruments Defense Electronics Information Systems VAX System Support McKinney, Texas ma bell: 214.952.2059 internet: bolthouse%mcopn1@ti-eg.com ------------------------------Cut here------------------------------------- !+ ! WHAT.TPU - Displays a message with the current line number, ! total number of lines in the file, and the percentage. !- ! procedure eve_what_line ! What line am I on? local this_position, ! marker - current position start_of_buffer, ! marker - beginning of current buffer this_line_position, ! marker - position at start of this_line total_lines, ! integer - total lines in buffer high_line, ! integer - high line limit for binary search low_line, ! integer - low line limit for binary search this_line, ! integer - line number of current guess percent; ! integer - percent of way through buffer ! Initialization this_position := mark (none); start_of_buffer := beginning_of (current_buffer); total_lines := get_info (current_buffer, "record_count") + 1; high_line := total_lines; if this_position = end_of (current_buffer) then low_line := total_lines; else low_line := 1; endif; ! Binary search loop exitif high_line - low_line <= 1; this_line := low_line + ((high_line - low_line) / 2); position (start_of_buffer); move_vertical (this_line - 1); if mark (none) > this_position then high_line := this_line; else low_line := this_line; if mark (none) = this_position then high_line := this_line; endif; endif; endloop; ! TPU will truncate numbers on division; make it round instead percent := (((low_line * 1000) / total_lines)+5)/10; ! Display message and return to original position message (fao ("You are on line !SL out of !SL (!SL%)", low_line, total_lines, percent)); position (this_position); endprocedure;