%%s 0/0/0 %%d D 1.1 25-Mar-82 12:12:55 v1.1 1 0 %%c Version 1.1 is the Spring 1982 Distribution of the LBL/Hughes release %%c of the Software Tools Virtual Operating System software and documentation. %%T %%I 1 #-h- ruler.r 1218 asc 25-mar-82 08:34:15 v1.1 (sw-tools v1.1) #-h- main 1145 asc 25-mar-82 08:33:55 v1.1 (sw-tools v1.1) ## Ruler - Draw a `ruler' columns wide on STDOUT. DRIVER(ruler) define(NUMSTRSIZE,12) character nstr(NUMSTRSIZE) integer i, n integer alldig, ctoi, getarg # function(s) string digstr "0123456789" string usestr "usage: ruler [n]." call query(usestr) if( getarg( 1, nstr, NUMSTRSIZE) == EOF ) n = 80 # Default width else if( alldig( nstr) == NO ) # Output error message call error(usestr) else { i = 1 n = ctoi( nstr, i) n = min( n, MAXLINE) # Limit 1 <= width <= MAXLINE n = max( n, 1) } for( i = 1 ; i <= n ; i = i + 1 ) # Output top row of ruling. if( mod( i, 10) == 0 ) call putc( '+') else call putc( '-') call putc( '@n') for( i = 1 ; i <= n ; i = i + 1 ) # Output `tens' digits. if( mod( i, 10) == 0 ) call putc( digstr( mod( mod( i, 100)/10, 10) + 1 )) else call putc( ' ') call putc( '@n') for( i = 1 ; i <= n ; i = i + 1 ) # Output `ones' digits. call putc( digstr( mod( i, 10) + 1 )) call putc( '@n') for( i = 1 ; i <= n ; i = i + 1 ) # Output bottom row of ruling. if( mod( i, 10) == 0 ) call putc( '+') else call putc( '-') call putc( '@n') DRETURN end #-h- ruler.fmt 445 asc 25-mar-82 08:34:17 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Ruler (1) 29-Oct-80 display ruler on terminal screen .sy ruler [n] .ds ruler displays a ruler on the terminal. This is especially useful when using field or other utilities which require knowledge of the column positions of portions of the screen. The optional numeric argument indicates how many columns to format in the ruler. .fl .sa field - utility for field manipulation .br sort - file sorter .di .au Dave Martin .bu %%E 1