This is the result from playing with 'jeb's append' and 'tooComplex's in the middle' technique to pass arguments.
I combine both and discover it harnesses jeb's simplification of passing args and tooComplex's splitting over multi vars.
Code: Select all
@echo off &setlocal disableDelayedExpansion
set $lf=^
::two line
set ^"$n1c=^^^%$lf%%$lf%^%$lf%%$lf%^^"
rem The 16k memory macro !
set ^"macro1=setlocal enableDelayedExpansion ^&for %%? in ( 1,2,3,4 ) do echo.%%? ^&if %%? == 2 ( %$n1c%
echo.This is macro1 8k of mem. %$n1c%
echo.we could setlocal here %$n1c%
echo.$arg=!$arg!_ %$n1c%
) else if %%? == 4 ( %$n1c%
echo.This is macro1 8k of mem. %$n1c%
echo.we could endlocal here %$n1c%
echo.$arg=!$arg!_ %$n1c%
) else ( set $arg="
set "macro2=) &if %%? == 3 echo.This is macro2 8k of mem. &echo.$arg=!$arg!_"
( %macro1% "This works, as you can see" %macro2% )
pause
exit
Code: Select all
1
2
This is macro1 8k of mem.
we could setlocal here
$arg= "This works, as you can see" _
3
This is macro2 8k of mem.
$arg= "This works, as you can see" _
4
This is macro1 8k of mem.
we could endlocal here
$arg= "This works, as you can see" _
Druk op een toets om door te gaan. . .
Macro2 8k macro specification don't have to deal with that.

Because this combo cannot be nested and requires to be called in an uncomfortable manner from user perspective,
I only use this as a last resort.