// // REVERSE-LINES.VDM Christian Ziemski 26.11.2005 // // // Reverses the order of lines in a block or the complete file // Num_Push(103,106) if (Block_Begin==-1) { // No block highlighted: do the complete file #103=0 // File position of beginning #104=MAXNUM // last line number of lines to be sorted #106=0 // flag } else { if (Block_End==-1) { // No end marker: use cursor position Block_End(Cur_Pos) } if (Block_End#104) { // stop if at end of block (if any) break } } #104=Cur_Line-(At_BoL) // remember current(=last) line#; incl. handling of last line without CR/LF Sort_Merge("1,10+(9*Is_Vedit_Pro64)", #103, Cur_Pos, REVERSE) // sort the lines reverse (by the leading number) Goto_Line(#104) // goto last of the sorted lines Del_Block(#103, Cur_Pos+10+(9*Is_Vedit_Pro64), COLUMN) // remove the numbers again if (#106) { // if block was set before: set it again now Line(1, NOERR) Block_Begin(#103) Block_End(Cur_Pos) Goto_Pos(Block_Begin) } Num_Pop(103,106)