Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!rutgers!ucla-cs!ames!sdcsvax!ucbvax!CITHEX.CALTECH.EDU!carl From: carl@CITHEX.CALTECH.EDU (Carl J Lydick) Newsgroups: comp.os.vms Subject: Re: Line number in EVE Message-ID: <870610171302.02j@CitHex.Caltech.Edu> Date: Wed, 10-Jun-87 20:13:02 EDT Article-I.D.: CitHex.870610171302.02j Posted: Wed Jun 10 20:13:02 1987 Date-Received: Sun, 21-Jun-87 00:41:51 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 61 > EVE (or TPU) has a built in key word CURRENT_ROW that holds the > the current line number - there is also a CURRENT_COLUMN for > the column the cursor is currently on. This is the procedure I > have implemented for our users: Wrong! The CURRENT_ROW primitive returns the the current row of the WINDOW from which it is called, not from the buffer. > procedure show_current_position > ! show current cursor position in buffer. > update(current_window); ! so that cursor info will be correct > message( fao("Cursor is at Row: !UL Column: !UL", > current_row, current_column)); > endprocedure This shows where you are in your window; if you scroll the window after using it, the values it gives are rendered worthless. > A key on the keypad has been defined to execute this procedure. > So all one has to do is press the key and (someone's VANILLA) VMS > will display the current cursor position. > Flame *ON* > I resent people calling names when they really do not understand > what a piece of software can/cannot do. There is NO software/OS > in the whole world that can do and mean everything to everyone. > Those of us who are familiar with VMS love it and those of you > who do not understand it better keep your mouth shut. My concern > is how can one be in VMS Systems Support Group when they claim > thay do not know enough of VMS?? My heart cries for the poor > employer who hires and pays such individuals. And I resent people distributing untested "solutions" to problems, simply because they haven't bothered to check to see that THEY understand what the software can do. If you REALLY want to find out what line of a buffer you're on, try using: PROCEDURE CURRENT_LINE_NUMBER LOCAL OLD_POSITION , LINE_NUMBER , TRIAL_VALUE , PLACE_MARKER ; ON_ERROR LINE_NUMBER := LINE_NUMBER - TRIAL_VALUE ; POSITION ( PLACE_MARKER ) ENDON_ERROR ; OLD_POSITION := MARK ( NONE ) ; MOVE_HORIZONTAL ( - CURRENT_OFFSET ) ; LINE_NUMBER := 1; TRIAL_VALUE := ( 1 + GET_INFO ( CURRENT_BUFFER , "RECORD_COUNT" ) ) / 2 ; LOOP EXITIF MARK ( NONE ) = BEGINNING_OF ( CURRENT_BUFFER ) ; PLACE_MARKER := MARK ( NONE ) ; LINE_NUMBER := LINE_NUMBER + TRIAL_VALUE ; MOVE_VERTICAL ( - TRIAL_VALUE ) ; TRIAL_VALUE := ( 1 + TRIAL_VALUE ) / 2 ; ENDLOOP ; POSITION ( OLD_POSITION ) ; CURRENT_LINE_NUMBER := LINE_NUMBER ; ENDPROCEDURE; And in the future, make sure that YOU have the right answer before flaming at someone who admits that he doesn't.