[bit.listserv.wp50-l] Q: What is maximum size of macros?

trevorc@UWOVAX.UWO.CA (Trevor Cradduck) (02/06/90)

Can anyone tell me the maximum size for a macro?

Perhaps I can pass along some experience that might be useful to
others -

I have spent the last n hours (where n is a large number!)
developing a macro to sort a WP Library Notebook file, merge it
with four different primary files, re-format the results and save
the files back to disc.

Initially I did this with a family of nested macros so that each
could be tested individually.  Once they were all working I
bundled all five macros into a single macro as subroutines, used
variables to pass values to the subroutines, and added lots of
comments.  This was done to avoid future problems with
inadvertant deletion or change of one of the macros within the
set.  The result exceeded 8k bytes and when run the macro stalled
after the first sort and prior to the first merge.

I summized that this was due to size limitations so reverted back
to nested macros, but retained all the added documentation.  That
was my downfall.  I had managed to insert a number of blank
comment lines with the lead {;} but no trailing tilde~.

After much frustration I eventually discovered my error,
recovered my composure (and some of the hair that had gone in the
process!), corrected the problem and it all ran as expected.

Encouraged by such sudden success I returned to a single macro
with subroutines changing the {NEST}'s back to {GO}'s.
Frustration reigns supreme - it now stalls at much the same point
as before - is the macro too big?  The merge files are
relatiively small (for testing).  The macro stalls with the
selected and sorted file displayed and the cursor at the top of
the file.  Control is returned to the operator.  The merge
subroutine fails to initiate.

The moral is:  If it ain't broke, don't fix it!

I will experiment (read de-bug) some more and, hoepfully, provide
some answers in a continuing saga.  In the meantime, how big can
a macro be?  That is the question.
---------
Trevor Cradduck <TREVORC@UWOVAX.UWO.CA>
University of Western Ontario, London, Canada
---------