! DK:MERGE.TXT   DATE: 1-JUN-83   TIME: 15:19:46 !

! merge routine, stored in reg. Y by UPDATE, invoked via RDIR or ESC W !
! append text to D, if any !
Z"G ZJ12I$H:XDHK'
! prompt for merge step, hang on "Y" (MZ drains KB, sets image typeout) !
MZ^A$H$K^G$p-UPDATE-P- INSERT DIRECTORY VOLUME - OK to proceed? (Y) ^A
<^T-^^Y"E0;'7^T>
! remove yank protect, hang on volume ID, check against reg. O !
2#EDED <HK ERDK:$ _DECRT11A$ 8R.,ZK24R :S^EQO$"S0;|MZ
^A$H$K^G$p-UPDATE-W- WRONG VOLUME - PLEASE CORRECT - OK to proceed? (Y) ^A
<^T-^^Y"E0;'7^T>>
! reset yank protect, write !
2^_&EDED
^A$H$K$p-UPDATE-I- UPDATING DIRECTORY FILE -^A
ERSY:SWAP.SYS$   ! force new directory read !
! open file, new stuff in workspace, append page by page + edit !
EB^EQF$GD 0,0XB
<ZJ.UA A QA-Z; QAJ XA J S^EQA$ QA-."L
   ! if no update on current input page, pass it to output and loop !
   ZJ12I$QA,ZPQA,ZKF<'
! keep old + new directories of this volume in workspace, rest back to D !
-L .UB           ! B --> front of new copy of current volume !
 QA,ZXC QA,ZK    ! current input page to C, then delete !
B,QBXDB,QBK      ! front end of new stuff to D, then delete !
J1^_&EDED S^L$   ! search for next FF !
.,Z:XD.,ZK       ! append tail of new stuff to D, then delete !
 JGCK.UA         ! ID + old copy on top, new copy with FF below !
! remove uncommented duplicates, collect commented copies in B !
J:XBL<.,.+10XA L .UB :S^EQA$"S 0LK QBJ -L:XBL' QB-QA; QBJ>
! append uncommented new entries with FF to B, retrieve D and loop !
QAJ.,Z:XB HKGD >
! wrap-up: present B and D for commenting, then close !
JGBJ Z"E         ! if no new text, close !
   EF MZ ^A$H$K$p^G^A
   ^A-UPDATE-I- REVISION COMPLETED - strike any key to exit -^A^T|
! else show close command, allow commenting !
   MZ^A$H$K$p^G^A
   ^A-UPDATE-P- COMMENT TO TASTE, THEN CLOSE FILE WITH HPEF -
---- strike any key to remove message and continue ---- ^A ^T'
^A$H$J$q^A1^_&ETET$$
                                                                                