On Tue 06 Dec 2022 at 14:26:19 -0000, Dave Wade wrote:
If you run UPDATE as below, to generate an file with the current source.
I made an exec to automate the process, and open the UPDATEd file in EE.
I called it VMFEE EXEC, modeled on VMFASM EXEC.
It also creates an UPDATE file if you edit the file and save it.
*
* Usage: VMFEE fn ctlfile
* VMFEE fn ft ctlfile
*
* Like VMFASM, update the given ASSEMBLE file with the UPDATES
* (given as the fn of the CNTRL file)
* but call EE to show the result (using $fn ft A).
*
* If you don't specify the file type, it is assumed to be ASSEMBLE
* like with VMFASM.
*
* If you save changes, a file "$fn UPDATE" is created.
*
* If this file already exists when invoking this exec,
* the updates are not re-done, but you can edit from where you left
* off.
* If you don't save changes, the temporary files are removed.
*
&CONTROL OFF
&IF &INDEX LT 3 &GOTO -ARGS2
-ARGS3 &NAME = &1
&FT = &2
&CNTL = &3
&GOTO -ARGDON
-ARGS2 &NAME = &1
&FT = ASSEMBLE
&CNTL = &2
*
-ARGDON &UPNM = $&NAME
&ANAME = &UPNM
&EDITOR = EE
*
-STSYS STATE &NAME &FT *
&IF &RETCODE EQ 0 &GOTO -STCTL
&TYPE *** &NAME &FT NOT FOUND ***
&EXIT 1
*
-STCTL STATE &CNTL CNTRL *
&IF &RETCODE EQ 0 &GOTO -STUPD
&TYPE *** &CNTL CNTRL NOT FOUND ***
&EXIT 2
* Did we edit this file before?
-STUPD &TYPE STATE &ANAME UPDATE A
STATE &ANAME UPDATE A
&IF &RETCODE EQ 0 &GOTO -DOEDIT
* Do the update
-FUPD UPDATE &NAME &FT * &CNTL CNTRL * ( CTL STK
&IF &RETCODE EQ 40 &ANAME = &NAME
&IF &RETCODE GT 12 &IF &RETCODE NE 40 &GOTO -UPDERR
* Get most recent update level
&IF &READFLAG EQ CONSOLE &GOTO -EXIT
&READ ARGS
&TEXT = &2
&READ ARGS
&ARGS &2 &3 &4 &5 &6 &7 &8 &9
*
&BAKFT = BAK&FT
COPY &ANAME &FT A = &BAKFT = (REPLACE
-DOEDIT &TYPE EDITING &ANAME &FT ... UPDATE &TEXT
&EDITOR &ANAME &FT
&GLOBAL0 = &RETCODE
&TYPE EDITED " &NAME &FT " ... UPDATE " &TEXT "
* Automatically generate some update statements from
* the differences, and put them in fn UPDATE A.
XCOMPARE &ANAME &BAKFT A = &FT = (CMSUPD
* Did the user change something?
STATE &ANAME UPDATE A
&IF &RETCODE EQ 0 &GOTO -UPDATED
* Since we didn't edit the file we may as well remove it
ERASE &ANAME &FT A
ERASE &ANAME &BAKFT A
&GOTO -EXIT
*
-UPDATED
&IF &RETCODE EQ 0 &TYPE UPDATE FILE " &ANAME UPDATE A " CREATED
-EXIT
&EXIT &GLOBAL0
---
-Olaf.
--
___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/ have kids to make his activity cost neutral." -The BOFH falu.nl@rhialto