// 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 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(/|
0) { BOF() S(/|@(1)/,ADVANCE+NOERR) } L(-1,NOERR) SVL(1)$,NOCONFIRM) Key_Add($^G$, $[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 F2 to not allow toggle to condensed views //Key_Add($F2$, $[VISUAL EXIT]if(BN>11) { #11 = (BN-11) BS(#11) CF(S_H_CR_LINE,0 ) } else {if(BX>11) { BS(1) } else { BS(BX()) }}$,NOCONFIRM) Key_Add($F2$, $[VISUAL EXIT]if(BN>11) { #11 = (BN-11) BS(#11,EVENT) } else {if(BX>11) { BS(1,EVENT) } else { BS(BX(),EVENT) }}$,NOCONFIRM) //******************************************************** // modify F3 to quit on altered condensed view without question //Key_Add($F3$, $[VISUAL EXIT]if(BN>11) {BQ(OK+DELETE) CF(S_H_CR_LINE,0 )} else {BQ(DELETE)} if (((Buf_Total()==1) && (Is_Altered==0) && (File_Size==0))) { Qally() }$,NOCONFIRM) //Key_Add($F3$, $[VISUAL EXIT]if(BN>11) {BQ(OK+DELETE) CF(S_H_CR_LINE,0 )} else {BQ(DELETE)}$,NOCONFIRM) Key_Add($F3$, $[VISUAL EXIT]if(BN>11) {BQ(OK+DELETE) BS(BN,EVENT)} else {BQ(DELETE) BS(BN,EVENT)}$,NOCONFIRM) //******************************************************** restore_pos() Buf_Switch(#12,LOCAL+EVENT) // edit .bn + 11 Win_Create(#12,6,50,10,28,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\/) // Line() makes the screen scroll