Google
 

Trailing-Edge - PDP-10 Archives - BB-R775E-BM - sources/edt/scrmoveto.bli
There are 10 other files named scrmoveto.bli in the archive. Click here to see a list.
 %TITLE 'SCRMOVETO - move to a specified text line'
MODULE SCRMOVETO (				! Move to a specified text line
		IDENT = '3-002'			! File: SCRMOVETO.BLI Edit: CJG3002
		) =
BEGIN
!
!			  COPYRIGHT (c) 1981, 1985 BY
!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!		ALL RIGHTS RESERVED.
!
! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
! ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE
! INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR  ANY  OTHER
! COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
! OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
! TRANSFERRED.
!
! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE
! AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT
! CORPORATION.
!
! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS
! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
!

!++
! FACILITY:	EDT -- The DEC Standard Editor
!
! ABSTRACT:
!
!	This module moves to a specified text line.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: September 8, 1979
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 12-Feb-1981.  This module was created by
!	extracting the routine MOVE_TO from module SCREEN.
! 1-002	- Regularize headers.  JBS 13-Mar-1981
! 1-003	- Return a value.  JBS 23-Oct-1982
! 3-001 - Add updates from V3 sources.  GB 03-May-1983
! 3-002 - Modify ASSERT macro to include error code. CJG 30-Jan-1984
!--
%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$SC_MOVTOLN;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$SC_MOVTOLN  - move to a specified text line'

GLOBAL ROUTINE EDT$$SC_MOVTOLN (		! Move to a specified text line
    N						! Target line number
    ) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Moves to a specified record.  N is the value of LN_NO  which we want
!	to move to.  Just keep going backward or forward until they match.
!
! FORMAL PARAMETERS:
!
!  N			The target relative record number
!
! IMPLICIT INPUTS:
!
!	LN_NO
!
! IMPLICIT OUTPUTS:
!
!	LN_NO
!
! ROUTINE VALUE:
!
!	1 = found the record
!	0 = no such record in this buffer
!
! SIDE EFFECTS:
!
!	May reposition us in the work file.
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$RD_NXTLN,				! Read the next line
	EDT$$RD_PRVLN;				! Read the previous line

    EXTERNAL
	LN_NO,				! Current relative record number.
	WK_LN : REF LN_BLOCK,		! Pointer to the current record in the work file
	EOB_LN : LN_BLOCK;		! Special record to signal [EOB]

    WHILE (.LN_NO GTR .N) DO
	BEGIN

	IF ( NOT EDT$$RD_PRVLN ()) THEN RETURN (0);

	LN_NO = .LN_NO - 1;
	END;

    WHILE (.LN_NO LSS .N) DO
	BEGIN

	IF ( NOT EDT$$RD_NXTLN ())
	THEN
	    BEGIN
	    ASSERT (7, .WK_LN EQLA EOB_LN);
	    ASSERT (7, (.LN_NO + 1) EQL .N);
	    END;

	LN_NO = .LN_NO + 1;
	END;

    RETURN (1);
    END;					! of routine EDT$$MOVTOLN

!<BLF/PAGE>
END						! of module EDT$SCRMOVETO

ELUDOM