/**************************/ /* Copy Block Xedit Macro */ /* M. Penner 5/31/83 */ /**************************/ Trace 'o' Do i=1 'CMSG CB01 Place cursor in UPPER left corner of block and press Enter.' Do j=1 Call Read_routine Select When result=0 Then Leave i Otherwise Leave j End End End start_line=line start_column=column Do i=1 'CMSG CB02 Place cursor in LOWER right corner of block and press Enter.' Do j=1 Call Read_routine Select When result=0 Then Leave i Otherwise Leave j End End End end_line=line end_column=column "MAKEBUF" 'TRANSFER SIZE TRUNC' Parse Upper Pull file_size trunc . If end_linefile_size Then Do 'EMSG CB07 *ERROR* Destination block exceeds file length.' Signal Exit End If to_column+width-1>trunc Then Do 'EMSG CB08 *ERROR* Destination block exceeds file truncation limits.' Signal Exit End 'TRANSFER LINE' Parse Upper Pull beginning_line . ':'start_line 'STACK' length start_column width If rc^=0 Then Do 'EMSG CB09 *ERROR* Stack error return code' rc Signal Exit End ':'to_line 'CLOCATE :'to_column Do length Parse Pull data 'CREPLACE' data 'NEXT' End ':'beginning_line Exit: "DROPBUF" Exit 0 /* end of program */ /*********************************************************************/ /* Subroutine to read from the command line and return the following */ /* data and codes. */ /* */ /* Rc= 0 - Good, variables 'line' and 'column' set. */ /* Rc= 1 - Command entered. */ /* Rc= 2 - Invalid cursor location. */ /* */ /*********************************************************************/ Read_routine: "MAKEBUF" 'COMMAND READ CMDLINE' Parse Upper Pull cmddata "DROPBUF" If Index(cmddata,'QUIT')^=0 Then Signal Exit If Left(cmddata,2)^='CB' Then Do Interpret cmddata Return 1 End 'COMMAND TRANSFER CURSOR' Parse Upper Pull . . line column . If column = -1 Then Do 'EMSG CB10 *ERROR* Invalid cursor location.... re-position and press Enter.' Return 2 End Return 0