[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Cross check program--code included



Okay, I've done a pretty nifty and radical file compare program using FD
and FM.
It's actually three programs, which I've added as frames to U2. The first
program sets up the windowing, to have two files side by side--i.e., it
splits the screen into two vertical columns, one for each file (same as
done through the A La Carte menus, but this is all via one keystroke--I use
alt-V for it.
The second, which I have assigned to alt-hyphen, takes you through the two
files together, in a coordinated way, and marks the successive differences
in each file by surrounding them with a special character (ascii 179) AND
putting them in a special color that I have assigned to MoDe IB. In using
TAME, I'm enabled to choose a pleasing foreground-background color for that
MoDe. If you are not using TAME, you have to either accept whatever 250 is,
or change things in some combination of my program and SETTINGS.DFL.
The third program, which is called as a daughter frame from the second,
keeps the two onscreen columns aligned, so that "hits" begin at row 15 for
each.
The nice thing about this new way of doing things is that once you've gone
through the whole files, by repeatedly hitting alt-hyphen (or your variant
for invoking it), the prettily marked differences are there in the files
for you to inspect, moving up and down as you will. The program does not
SAve the file, so you can abort or do a CI to eliminate the ≪MD+IB≫[179]
and [19]≪MD-IB≫, and then save.
These have been only moderately tested, and I'm not good about making code
independent of system-settings, so let me know if you have problems.
Here the three are as U2 frames. (If you want stand-alone programs, you'll
have to make some minor modifications: e.g., eliminate the ascii 2's and
change the JM 2.HB15 to BX run hb15.pgmQ2.)
1. Ctrl-V frame to array the 2 files vertically in one window (requires JM
2. @V in kbd file):

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5@V}}[cr|lf]{002}[BX_]ldkbd c:\xy\runpgm.kbd[Q2_];*;[cr|lf
][BC_]{176}PRIs this the base file? (-/n){177};*;[cr|lf]{176}
RC{177}{176}IF{176}VA$KC{177}==49{177}[BX_]ldkbd c:\xy\macr.k
bd[Q2_][BC_]{176}PRAborted{177}{176}EX{177}{176}EI{177};*;[cr
|lf][AS_][BC_]{176}PRIs this the other file? (-/n){177};*;[cr
|lf]{176}RC{177}{176}IF{176}VA$KC{177}==49{177}[BX_]ldkbd c:\
xy\macr.kbd[Q2_][BC_]{176}PRAborted{177}{176}EX{177}{176}EI{1
77};*;[cr|lf]{176}SX02,{176}VA$NR{177}{177};*;[cr|lf]{176}SV0
9,0{177}{176}IF{176}VA$NR{177}==2{177}{176}SX09,1{177}{176}EI
{177};*; 09 is an offset for use in s/g 12[cr|lf]{176}SX10,{1
76}VA$WN{177}{177};*;window number[cr|lf]{176}SX12,{176}VASL{
177}-{176}PV09{177}-4{177};*; net screen length[cr|lf][BX_](W
INDOW {176}PV10{177},1,1,39,{176}PV12{177})[GT_][AS_]{176}SX1
1,{176}VA$WN{177}{177};*;[cr|lf][BX_](WINDOW {176}PV11{177},4
1,1,38,{176}PV12{177})[GT_][AS_][BX_]ldkbd c:\xy\macr.kbd[Q2_
];*;[cr|lf]{176}EX{177}{002}[cr|lf]
-nd
XPLeNCODE

2. The main frame, put on alt-hyphen (requires a JM 2. @- in the kbd file):

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5@-}}[cr|lf]{002}[BX_]es 1[Q2_];*;[cr|lf]{176}SV01,{177}[D
X_][DE_][XD_][AS_][DE_][XD_][AS_][FD_][BX_]md +ib[Q2_];*;[cr|
lf]{181}[AS_][BX_]md +ib[Q2_];*;[cr|lf]{181}[AS_][FM_]{181}[B
X_]md -ib[Q2_];*;[cr|lf][AS_]{181}[BX_]md -ib[Q2_];*;[cr|lf][
AS_];*;[cr|lf][JM_]2.HIDE:01-20[Q2_];*;[cr|lf][JM_]2.HB15[Q2_
];*;[cr|lf][JM_]2.UNHIDE[Q2_];*;[cr|lf][DO_]{002}[cr|lf]
-nd
XPLeNCODE
3. The HB15 frame for coordinating the displays (not really required, but nice):

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5hb15}} Move line under to row 15 [HB][cr|lf]{002}[GT_][DX
_];*;[cr|lf]{176}SX01,15-{176}VA$CY{177}{177};*;[cr|lf]{176}I
F{176}PV01{177}>0{177}{176}CUa,01{177}[MD_]{176}LBa{177}{176}
EI{177};*;[cr|lf]{176}IF{176}PV01{177}<0{177}{176}CUb,01{177}
[MU_]{176}LBb{177}{176}EI{177};*;[cr|lf][AS_][GT_];*;[cr|lf];
*;[BX_]wait[Q2_];*;[cr|lf]{176}SX01,15-{176}VA$CY{177}{177};*
;[cr|lf];*;{176}PR@01{177}{176}EX{177};*;[cr|lf]{176}IF{176}P
V01{177}>0{177}{176}CUc,01{177}[MD_]{176}LBc{177}{176}EI{177}
;*;[cr|lf]{176}IF{176}PV01{177}<0{177}{176}CUd,01{177}[MU_]{1
76}LBd{177}{176}EI{177};*;[cr|lf][AS_]{002}[cr|lf][cr|lf]
-nd
XPLeNCODE
Note: if you are using $X to make ENTER function as , you may need to make adjustments to this frame--email me.


Harry Binswanger
hb@xxxxxxxx