Weave means that you create the batch from a source file, and then untangle the batch from it. The simplest form is simply to turn the print processor on and off, rather like
Code:
set batch=batchname
echo REM made from %_batchname > %batch%
begin comment
Comments go here
end comment
begin text > %batch
Code goes here
end text
rem and so forth
I wrote a really advanced form of weave, which allows you to make several files up, and use native rexx variables and operations in the script. You can do things like produce rows of data from a table etc.
Here's how one might approach an IFF statement in 4NT. It's a fairly complex thing, and we really have to make sure it's all kept together. It's pretty easy to see how the payees are selected here.
!src and !lbl are labels, while !lbl and !end are implicit returns. !src and !end mark an active block of code, so the line at 'Here is... ' is not loaded into memory. !inc LBL runs the code from a label LBL to its implicit return. Nesting is limited by REXX's arrays (ie very large).
Code:
!src switchpayee
iff condition1 then
!inc condition1 ; Payee male
elseiff condition2 then
!inc condition2 ; Payee female
elseiff condition3 then
!inc condition3 ; Payee company
else
!inc condition0
endiff
!end
Here is what happens at each case.
!src condition1
code for condition 1 goes here
!lbl condition2
code for condition 2 goes here
!lbl condition3
...
!end
The feature here is that the whole ENDIFF is given here clearly, with no further need of documentation. The includes can point to the same set of code, or of it's modular, you can include several !inc between the lines, or point several conditions to the same block (ie condition3 could have been 'condition1'.
Once this is written, the actual conditional codes are then documented separately.
None of this documentation appears in the actual code, and redundant code can be bypassed and still left in the source code (i put debug statements in like this).
Using ! to open commands comes from editing the JP software 4DOS.HLP file too much. Many of my text editors fold on !topic, which i use as a way to create a live index for the file, as well as keeping a tab on the current point.
I've used this sort of stuff to write blank floppy diskette images, which involve repeated writing of the same code.