Google
 

Trailing-Edge - PDP-10 Archives - bb-h138f-bm - 7-sources/chminstab.bli
There are 11 other files named chminstab.bli in the archive. Click here to see a list.
 %TITLE 'CHMINSTAB - reach a column'
MODULE CHMINSTAB (				! Reach a column
		IDENT = '1-002'			! File: CHMINSTAB.BLI Edit: JBS1002
		) =
BEGIN
!COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1981, 1988.  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 THAT IS NOT SUPPLIED BY DIGITAL.
!
!
!++
! FACILITY:	EDT -- The DEC Standard Editor
!
! ABSTRACT:
!
!	This module does (change mode) insertion of tabs and
!	spaces to bring the cursor to a given column.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: Unknown
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 04-Feb-1981.  This module was created by
!	extracting the routine INSERT_TABS from module CHANGE.BLI
! 1-002	- Regularize headers.  JBS 03-Mar-1981
!--

%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$MOV_TOCOL;				! Insert tabs and spaces

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$MOV_TOCOL  - reach a column'

GLOBAL ROUTINE EDT$$MOV_TOCOL (			! Reach a column
	COUNT					! Number of columns to move
    ) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine inserts enough tabs and spaces to bring us to the
!	column specified by count.
!
! FORMAL PARAMETERS:
!
!  COUNT		Number of columns to move
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	1 is returned if it succeeds, 0 if the line overflows.
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$INS_STR;				! Insert a string of characters at the current position

!+
! Insert count/8 tabs.
!-

    INCR I FROM 1 TO .COUNT/8 DO

	IF (EDT$$INS_STR (CH$PTR (UPLIT (%CHAR (ASC_K_TAB))), 1) EQL 0)
	THEN
	    RETURN (0);

!+
! Insert count mod 8 spaces.
!-

    INCR I FROM 1 TO .COUNT MOD 8 DO

	IF (EDT$$INS_STR (CH$PTR (UPLIT (' ')), 1) EQL 0)
	THEN
	    RETURN (0);

    RETURN (1);
    END;


END
ELUDOM