dc.{DO} CRT {-A} {-I} {@}file... {>out_file} c. Shows a file in 22 line chunks. ,c.  PROGRAM CRT c. Xc. Show a file, or series of files, in 22 line blocks. c. The display can be stopped at the end of each PAGE. c. c. -A causes the line count to be neglected c. -I causes only the lines to a -end.of.info - to be displayed. Rc. or c. c.-end.of.info- Lc. c. Feb 02, 1980 -- Mike Liveright -- SCI c. Feb 04, 1980 -- readonly Fc. Mar 11, 1980 -- -A , , and file i.d. xc.  character*40 string @c. 41 format(10a) c=== l call jjcmd('CRT') c. 4 do 290 i=1,10  if( jjcmdarg(i,string) .ne. 0 ) then  if( string.eq.'?' ) then ` write( 3,* ) 'Usage: CRT {-A} {-I} {{@}file...} {>file}' else ( iun = 4 if( string(1:1).eq.'@' ) then open( unit=iun, name=string(2:), type='old',err=250 T 1 , readonly ) iun = 9  225 continue read( 4,41, end=290 ) string write(2,41)'1',string write(2,41)' ' write(2,41)' ' open( unit=iun, name=string, type='old',err=250 H 1 , readonly ) call docrt( iun, string )  close( unit=iun ) t goto 225  else < open( unit=iun,name=string,type='old',err=250  1 , readonly )  call docrt( iun, string ) h close( unit=iun )  goto 290 0 endif c. 250 continue \ write( 3, 254 ) ' Can''t open input ',iun,' =',string 254 format( a,i2,10a ) $c.  endif  endif P290 continue c. 295 continue |c.  end dc========= c-h- docrt( iunit, fname ) ,c.  subroutine docrt( iunit, fname )  character*(*) fname Xc.  character*132 line  common /cscisw/ iscisw(26) ! -I == not all  character*1 inmore c. L data lincur/1/ c. 41 format( 10a ) x42 format( q, 10a ) 43 format( a, i5, 10a ) @c=== 200 continue  read(iunit,42,end=900) num, line l if( iscisw(9) .and.  1 ( index( line,'-end.of.info-') .ne. 0 4 2 .or. index( line, '-END.OF.INFO-') .ne. 0 U 1 .or. index( line,'') .ne. 0 v 2 .or. index( line, '') .ne. 0 ) ) goto 900  if( lincur.ge.23.and.( .not. iscisw(1) )) then  type 41,'$more?' ` read(5,41,end=900) inmore if( ichar(inmore).and.1 ) goto 900 ( lincur = 1 endif lincur = lincur+1 T write(2,41)' ',line(1:num) goto 200  c. 900 continue end dc========= c-h- jjcmd(pname) .fun. initalize based on command line ,c. c. jjcmd << +2**i of units can't open c. X function jjcmd( pname )  character*(*) pname  integer*4 cmdlin(7)  data cmdlin(1)/1/ c=== L call sys$cli( %ref(cmdlin) )  jjcmd = jjcmda( cmdlin(3), pname ) c. x return  end @c========== c-h- jjcmda(string,pnam) .fun. process command c. lc. jjcmda << +2**i of units can't open c. 4 function jjcmda( string, pname )  character *(*) string, pname  common /cscisw/ iscisw(26) ` character*115 cmdtemp character*40 fname ( c. c. 1=input, 2=output, 3=error c. T data narg/3/ integer ifst(40), ilst(40)  41 format( 10a ) c=== jjcmda = 0 H cmdtemp = 'sys$output ?sys$error' cmdtemp(35:) = string c... write(6,987)' Cmd',len(string), string, pname t987 format( a, i,' __',a,'__',a,'__' ) c. < if( cmdtemp(35:).eq.pname.or. len(string) .eq. 0 ) then  type 41,'$',pname,' cmd: '  read( 5,41,err=250) cmdtemp(35:) h endif c. 0250 continue  inblank = .true.  inout = .false. \ do 290 i=1,115  if( inblank ) then $ if( cmdtemp(i:i).le.' ' ) goto 290  inout = .true.  inpar = .false. P if( cmdtemp(i:i).eq.'<' ) then  iname = 1  else if( cmdtemp(i:i).eq.'>' ) then | iname = 2  else if( cmdtemp(i:i).eq.'?' D 1 .and. cmdtemp(i+1:i+1).ne.' ') then  iname = 3  else if( cmdtemp(i:i).eq.'-' ) then p inpar = .true.  else 8 iname = narg+1  inout = .false.  endif d if( cmdtemp(i:i) .ne. '-' ) then  ifst(iname) = i , endif  inblank = .false.  else if( inpar ) then X if( cmdtemp(i:i).le.' ' ) then  inblank = .true.  else  inx = ichar(cmdtemp(i:i))-ichar('A')+1  if( inx.gt. 26 ) inx = inx-32 L if( inx.ge.1 .and. inx.le.26 ) then  iscisw(inx) = .true.  endif x endif  else if( cmdtemp(i:i).le.' ' ) then @ if( .not. inout ) then  narg = narg+1  endif l ilst(iname) = i-1 inblank = .true. 4! endif !290 continue !c. `"900 continue " do 990 i=1,3 (# fname = cmdtemp(ifst(i)+1:ilst(i)) # if( i.eq.1 ) then # open( unit=i,name=fname,type='old',err=950 T$ 1 , readonly ) $ else % open( unit=i,name=fname,type='new', % 1 err=950 ) % endif H& goto 990 &950 continue ' jjcmda = jjcmda + 2**i t' write(6,954)' Can''t open unit ',i,,' =',fname '954 format( a, i1, 10a ) <(990 continue ( return )c=== h)c-h- jjcmdarg(inx,string) .fun. get inx'th arg )c. 0*c. jjcmdarg << length of argument *c. * entry jjcmdarg( inx, string ) \+c=== + jjcmdarg = 0 $, string = ' ' , if( inx+3.le.narg ) then , jjcmdarg = ilst(inx+3)-ifst(inx+3)+1 P- string = cmdtemp( ifst(inx+3):ilst(inx+3) ) - endif .c. |. return . end D/c========= /c-h- jjlen( string ) .fun. 0c. p0 integer function jjlen( string ) 0 character*(*) string 81c. 1 do 290 i=len(string),2,-1 2 if( string(jjlen:jjlen).gt.' ' ) goto 295 d2290 continue 2295 continue ,3 return 3 end