! UTRING.BAS - puts 5 spaces at the beginning of each line to
! make room for the holes punched for a ring binder
!
! Copyright @1985 by David W. Barrow III
!
! Date Who L What
!-------- --- - ---------------------------------------------------
!05-23-85 DWB A Original Coding
!
MAP1 VERSION,S,9,"VER052385"
PROGRAM PGMNAM,85.05A(23)
! HOUSEKEEPING:
! Standard Error Routine
ON ERROR GOTO ERR'ROUTINE
PRINT TAB(-1,0) ! Clear screen
PRINT TAB(01,05); "UTRING is a Utility program to take a file "; &
"and add 5 spaces to the"
PRINT TAB(02,01); "beginning of each line in order to make room "; &
"for holes for a 3 ring binder."
PRINT TAB(04,05); "Written by David W. Barrow III of the Stonewall"; &
" Computer Center"
PRINT TAB(06,01)
STOP
PRINT TAB(09,01); "What is the name of the input program (NNNNNN) : ";
INPUT INPUT'FILE'NAME
GET'EXT:
PRINT TAB(11,01); "What is the extention of the input file (.NNN) : ";
INPUT INPUT'FILE'EXT
! Check for period
IF ( INPUT'FILE'EXT[1,1] # "." ) &
THEN GOTO GET'EXT
OUTPUT'FILESPEC = INPUT'FILE'NAME + ".NBK"
OPEN #1, INPUT'FILE'NAME + INPUT'FILE'EXT, INPUT
OPEN #2, OUTPUT'FILESPEC, OUTPUT
! MAINLINE:
FOR COUNTER = 1 TO 10000
INPUT LINE #1, INPUT'LINE
! Check for end of file
IF ( EOF(1) # 0 ) &
THEN COUNTER = 10000
OUTPUT'LINE = SPACE$(5) + INPUT'LINE
PRINT #2; OUTPUT'LINE
NEXT COUNTER
! EXIT:
CLOSE #1
CLOSE #2
XCALL SPOOL, OUTPUT'FILESPEC
END
!!!!!!!!!!!!!!!!!!!!!!!
! PROGRAM SUBROUTINES !
!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!
! STANDARD SUBROUTINES !
!!!!!!!!!!!!!!!!!!!!!!!!
ERR'ROUTINE:
! Check for AlphaBASIC error
IF ( ERR(0) = 0 ) &
THEN GOTO ISAM'ERROR
! Display Basic error
PRINT TAB(-1,0) ! Clear Screen
PRINT TAB(12,15); "?? Fatal AlphaBASIC Error "; STR$(ERR(0))
ON ERR(0) CALL C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, &
C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, &
C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, &
C31, C32, C33, C34, C35, C36, C37, C38, C39, C40, &
C41, C42, C43, C44, C45, C46
IF ( ERR(1) ) &
THEN PRINT TAB(13,15); " on the line after "; STR$(ERR(1))
IF ( ERR(2) ) &
THEN PRINT TAB(14,15); " on Channel "; STR$(ERR(2))
GOTO ERROR'ABORT
ISAM'ERROR:
! IF (
ERROR'ABORT:
PRINT TAB(20,15); "!! Contact System Operator Immediately !!"
PRINT TAB(21,01);
END