tenaglia@astroatc.UUCP (Chris Tenaglia) (04/14/88)
Greetings , I am a proponent of the EVE/TPU editor. I am looking for a TPU routine to improve on the "fill paragraph" command. Currently "fill paragraph" leaves the right margin jagged. I would like to know if there is an existing option or handy TPU procedure that would do "fill paragraph" with both left and right justification. These paragraphs were manually alligned. A tedious process indeed. Does anyone have a spiffy technique in DCL to check whether a file is locked by another user or not? CHECKSUMs on locked files seem to get wedged in some sort of deadlock. Thanx in advance, Chris Tenaglia Astronautics Corporation of America 4115 N. Teutonia Avenue Milwaukee, Wi 53209 USA (414) 447-8200 X-450
carl@CITHEX.CALTECH.EDU (Carl J Lydick) (04/20/88)
> I am a proponent of the EVE/TPU editor. I am looking for a TPU routine > to improve on the "fill paragraph" command. Currently "fill paragraph" > leaves the right margin jagged. I would like to know if there is an > existing option or handy TPU procedure that would do "fill paragraph" > with both left and right justification. These paragraphs were manually > alligned. A tedious process indeed. This may not be exactly what you want (it uses DSR to do the job, leaves the original text intact, and puts the output of DSR at the bottom of the buffer. It takes as an argument a range, buffer, or string. Invoke it as <DO>TPU RUNOFF(source)<RET>. -----------------------------Begin Procedure RUNOFF----------------------------- PROCEDURE RUNOFF ( MY_SOURCE ) LOCAL MY_CRLF , MY_RANGE , MY_MARK ; ON_ERROR POSITION ( END_OF ( MY_BUFFER ) ) ; MOVE_TEXT ( FAO ( "!80**" ) ) ; MOVE_TEXT ( RUNOFF_BUFFER ) ; POSITION ( MY_MARK ) ; RETURN ; ENDON_ERROR ; IF GET_INFO(RUNOFF_BUFFER, "TYPE") <> BUFFER THEN RUNOFF_BUFFER := CREATE_BUFFER ( 'RUNOFF_BUFFER' ); SET(NO_WRITE, RUNOFF_BUFFER, ON); ENDIF; MY_BUFFER := CURRENT_BUFFER ; MY_MARK := MARK ( NONE ) ; IF GET_INFO(RUNOFF_PROCESS, "TYPE") <> PROCESS THEN RUNOFF_PROCESS := CREATE_PROCESS(RUNOFF_BUFFER,'SET NOVERIFY'); ENDIF; SEND ( 'DEASSIGN/PROCESS/ALL' , RUNOFF_PROCESS ) ; SEND ( 'RUNOFF/OUTPUT=SYS$OUTPUT: SYS$INPUT:' , RUNOFF_PROCESS ) ; SEND ( '.LEFT MARGIN 0' , RUNOFF_PROCESS ) ; SEND ( '.RIGHT MARGIN 78' , RUNOFF_PROCESS ) ; ERASE(RUNOFF_BUFFER); SEND ( MY_SOURCE , RUNOFF_PROCESS ) ; SEND_EOF ( RUNOFF_PROCESS ) ; POSITION ( BEGINNING_OF ( RUNOFF_BUFFER ) ) ; MY_CRLF := ASCII ( 13 ) + ASCII ( 10 ) ; LOOP MY_RANGE := SEARCH ( MY_CRLF , FORWARD ) ; EXITIF MY_RANGE = 0 ; POSITION ( MY_RANGE ) ; ERASE ( MY_RANGE ) ; ENDLOOP ; ENDPROCEDURE ; ------------------------------End Procedure RUNOFF------------------------------ To make it a bit more convenient, you can set up the following procedure as well. To use it, SELECT the text you want to run off, then use <DO>RUNOFF<RET>. ---------------------------Begin Procedure EVE_RUNOFF--------------------------- PROCEDURE EVE_RUNOFF RUNOFF(SELECT_RANGE); ENDPROCEDURE; ----------------------------End Procedure EVE_RUNOFF---------------------------- > Does anyone have a spiffy technique in DCL to check whether a file is > locked by another user or not? CHECKSUMs on locked files seem to get > wedged in some sort of deadlock. How about: $ CHECK_LOCK: SUBROUTINE $ ON WARNING THEN GOTO BAD $ OPEN/APPEND FILE 'P1' $ CLOSE FILE $ EXIT 1 $ BAD: EXIT $STATUS $ ENDSUBROUTINE or something like that? -------