// // STRCHECK.VDM Christian Ziemski 21.09.2004 // 07.10.2004 // // // Checks/compares strings in two files // and makes them visible and easily editable. // // // Requires exactly *two* buffers opened: The two to compare. // If the windows are not tiled that will be done automatically. // // Tip: Assign it to a key or to mouse-double-click (T-Reg 116). // //---------------------------------------------------------------------- if (Buf_Total != 2) { Dialog_Input_1(106,"`STRCHECK - Error!`, `This macro requires exactly *two* buffers opened.`", WORKAREA+CENTER,0,0) return } if (Win_Overlap!=4) { Win_Tile(0) // if not tiled and completely visible: force vertical tile } // disable cursor line highlighting in both buffers Buf_Switch(Buf_Next, NOEVENT) Config( D_H_CR_LINE, "Highlight cursor line (1=Full, 2=Partial)", 0 , LOCAL) Update Buf_Switch(Buf_Next, NOEVENT) Config( D_H_CR_LINE, "Highlight cursor line (1=Full, 2=Partial)", 0 , LOCAL) Update #103=Win_Vert if (BB == -1) { if (BE == -1) { #105=0 Mark_Word() } else { #105=1 BB=Cur_Pos } } else { #105=1 if (BE == -1) { BE=Cur_Pos } else { if ((Cur_Pos < BB) || (BE < Cur_Pos)) { BB(CLEAR) #105=0 Mark_Word() } } } Reg_Copy_Block(105, BB, BE) Buf_Switch(Buf_Next, NOEVENT) Win_Switch(Win_Next) #106=Cur_Pos #107=Win_Vert #104=0 if (Match(@105)==0) { // if already on found string Line(1, NOERR) #104=1 } else { BoF } :AGAIN: Search("|@(105)", NOERR) Update if (Error_Match) { // if not found if (#104) { BoF #104=0 Goto AGAIN } Goto_Pos(#106) SVL(#107) Update Statline_Message("'|@(105)' not found.") } else { SR_Set(@105) Set_Visual_Line(#103) Config( CO_W_LINE, "Color for cursor line (override)", 32 , LOCAL) // green Config( D_H_CR_LINE, "Highlight cursor line (1=Full, 2=Partial)", 2 , LOCAL) Update Statline_Message(" ") } Buf_Switch(Buf_Next, NOEVENT) Config( D_H_CR_LINE, "Highlight cursor line (1=Full, 2=Partial)", 0 , LOCAL) if (!#105) { BB(CLEAR) } Update