/**************************/ /* Move Block Xedit Macro */ /* M. Penner 5/31/83 */ /**************************/ Trace 'o' Do i=1 'CMSG MB01 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 MB02 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_linetrunc Then Do 'EMSG MB06 *ERROR* Origin block exceeds file truncation limits.' Signal Exit End Do i=1 'CMSG MB03 Place cursor in UPPER left corner of destination and press Enter.' Do j=1 Call Read_routine Select When result=0 Then Leave i Otherwise Leave j End End End to_line=line to_column=column length = end_line - start_line + 1 width = end_column - start_column + 1 If to_line+length-1>file_size Then Do 'EMSG MB07 *ERROR* Destination block exceeds file length.' Signal Exit End If to_column+width-1>trunc Then Do 'EMSG MB08 *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 MB09 *ERROR* Stack error return code' rc Signal Exit End ':'start_line 'CLOCATE :'start_column Do length 'COVERLAY' Substr('_',1,width,'_') 'NEXT' 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)^='MB' Then Do Interpret cmddata Return 1 End 'COMMAND TRANSFER CURSOR' Parse Upper Pull . . line column . If column = -1 Then Do 'EMSG MB10 *ERROR* Invalid cursor location.... re-position and press Enter.' Return 2 End Return 0