// From:Richard Hureau (rhureau@metlife.com) // Date: Thursday, March 04, 1999 08:08 AM // // // CONDENSE for C macro; uses treg buf_num +11 for output; // // Uses nregs 11 and 12 as work areas; // treg 92 as another work area; final display in buffer buf_num + 11 // // Modified by C.Z. 10.03.1999 // reg_set(114,"if (BN>11){CF(S_H_CR_LINE,2)} else {CF(S_H_CR_LINE,0)}") save_pos() Begin_Of_File() #11 = Buf_Num // store current buffer in nreg 11 #12 = (Buf_Num + 11) // store target treg in nreg 12 Reg_Empty(#12) Buf_Switch(#12) // goto it in case it exists to quit it Buf_Empty(OK) Buf_Close(DELETE) Buf_Switch(#11) // back to current buffer Search(/|
{}, ) {}, // ) {} /* */ Line(-1) // Backup to beginning of function declaration // // Skip this occurrence if 1st char is not alphanumeric. // if ((Cur_Char < 65 || Cur_Char > 122)) { Line(1,NOERR) Continue } Reg_Copy(#12,1,APPEND) // put located line into treg Line(1) // next line } Reg_Set(#12,/-- F4 to go to line program and back -- -- Shift-F4 to quit condensed view -- -- Shift-F2 to rebuild condensed view - --------------------------------------- /,INSERT) // Get filename Out_Reg(92) Name_Write(NOCR+NOMSG) Out_Reg(CLEAR) Reg_Set(92,/** /,INSERT) Reg_Set(92,/ CONDENSATION ** /,APPEND) // //******************************************************** // the following builds GONUM.VDM into F4 Key_Add($F4$, $[VISUAL EXIT] if(BN<12) { #11 = (BN+11) BS(#11,EVENT) Return } L(0) RC(1,1) #11 = (BN-11) BS(#11,EVENT) BOF(LOCAL) S( /|@(1)/,ADVANCE+NOERR) if(EM<>0) { BOF() S(/|@(1)/,ADVANCE+NOERR) } L(-1,NOERR) SVL(1)$,NOCONFIRM) //******************************************************** // modify F5 to not allow toggle to condensed views Key_Add($F5$, $[VISUAL EXIT]if(BN>11) { #11 = (BN-11) BS(#11,EVENT) } else {if(BN>1) { BS(BN-1,EVENT) }}$,NOCONFIRM) //******************************************************** // modify F6 to not allow toggle to condensed views Key_Add($F6$, $[VISUAL EXIT]if(BN>11) { #11 = (BN-11) BS(#11,EVENT) } else {if(BX>11) { BS(1,EVENT) } else { BS(BX(),EVENT) }}$,NOCONFIRM) //******************************************************** // modify Shift-F2 to rebuild Condensed view Key_Add("Shft-F2", "[VISUAL EXIT] call_file(100, 'condc.vdm')",NOCONFIRM) //******************************************************** // modify Shift-F4 to quit on altered condensed view without question //Key_Add($Shft-F4$, $[VISUAL EXIT]if(BN>11) {BQ(OK+DELETE) BS(BN,EVENT)} else {BQ(DELETE) BS(BN,EVENT)}$,NOCONFIRM) Key_Add($Shft-F4$, $[VISUAL EXIT]if(BN>11) {BQ(OK+DELETE) }$,NOCONFIRM) //******************************************************** restore_pos() Buf_Switch(#12,LOCAL+EVENT) // edit .bn + 11 Win_Create(#12,6,50,10,40,ATTACH) Reg_Ins(#12) // insert treg #12 into edit buf #12 BOF() Reg_Ins(92,BEGIN) Reg_empty(#12) Reg_empty(92) DOV(/\CD\\CD\\CD\\CD\\CD\/) // Line() makes the screen scroll BB(Clear) return // // the following builds GONUM.VDM into F4 // // if(BN<12) { // #11 = (BN+11) // BS(#11,EVENT) // Return // } // L(0) // RC(1,1) // #11 = (BN-11) // BS(#11,EVENT) // BOF(LOCAL) // S(/|@(1)/,ADVANCE+NOERR) // if(EM<>0) { // BOF() // S(/|@(1)/,ADVANCE+NOERR) // } // L(-1,NOERR) // SVL(1) // modify F5 to not allow toggle to condensed views // // (new) // // if(BN>11) { // #11 = (BN-11) // BS(#11,EVENT) // } else { // if(BN>1) { // BS(BN-1,EVENT) // } // } // modify F6 to not allow toggle to condensed views // // if(BN>11) { // #11 = (BN-11) // BS(#11,EVENT) // } else { // if(BX>11) { // BS(1,EVENT) // } else { // BS(BX(),EVENT) // } // } // modify Shift-F4 to quit on altered condensed view without question // // (original version:) // // if(BN>11) { // BQ(OK+DELETE) // BS(BN,EVENT) // } else { // BQ(DELETE) // BS(BN,EVENT) // } // // (new version:) // // if(BN>11) { // BQ(OK+DELETE) // BS(BN,EVENT) // }