'
I don't understand why you introduce extra line feeds within your macro definitions
It seems to work either way
, but I find the code much easier to read in the more compressed form.
Ok then, let's suppose I did it your way &defined RULE on a single line.
Let's suppose I made a syntax error inside the RULE definition.
I won't be using linefeeds;
What this means is that I will have to scroll from the left to the right a couple of hundred characters !
I won't be using indention;
every time I encounter a '(' I will have to memorize it !
Additionally I would have to cut the entire line, make it shorter and paste it again ( hoping I did it correctly ).
So which one would be easiest to debug
Code: Select all
set ^"FileOpen=( %$n1c%
set ^^^^^"RULE=( ^^^!$n0^^^!^^^^%$n2c%
%$c2%
^^^^^>nul 2^^^^^>^^^^^&1 reg delete "^^^!$ED.Path^^^!" /v "FileOpen" /f ^^^^^&^^^^^&( ^^^!$n0^^^!^^^^%$n2c%
%$c2%
^^^^^>nul 2^^^^^>^^^^^&1 reg query "^^^!$ED.Path^^^!" /v "FileOpen.%%~^^^!" ^^^^^&^^^^^&( ^^^!$n0^^^!^^^^%$n2c%
%$c2%
set /a ù = 1 ^^^!$n0^^^!^^^^%$n2c%
%$c2%
^^^^^) ^^^^^|^^^^^|( ^^^!$n0^^^!^^^^%$n2c%
%$c2%
set /a ù = 0 ^^^!$n0^^^!^^^^%$n2c%
%$c2%
for /f "tokens=1-4" %%%%b in ( ^^^!$n0^^^!^^^^%$n2c%
%$c2%
" "%E7%!$ED.Path%E7%!" "FileOpen.%%~%E7%!" "REG_SZ" "%E7%^^^^!Sub.^^^!Sub.Depth^^^!.Name%E7%^^^^!" " ^^^!$n0^^^!^^^^%$n2c%
%$c2%
^^^^^) do %E7%^^^^!ERR.Chk.RegWrite.TokenSTR%E7%^^^^! ^^^^^>nul ^^^^%$n1c%
%= =%
^^^^^) ^^^!$n0^^^!^^^^%$n2c%
%$c2%
for /f "tokens=1-4" %%%%b in ( ^^^!$n0^^^!^^^^%$n2c%
%$c2%
" "%E7%!$ED.Path%E7%!" "FileOpen" "REG_SZ" "Ready" " ^^^!$n0^^^!^^^^%$n2c%
%$c2%
^^^^^) do %E7%^^^^!ERR.Chk.RegWrite.TokenSTR%E7%^^^^! ^^^^^>nul ^^^!$n0^^^!^^^^%$n2c%
%$c2%
^^^^^) ^^^^^|^^^^^|set /a ù = 1 ^^^!$n0^^^!^^^^%$n2c%
%$c2%
if %E7%^^^^!ù%E7%^^^^! neq 0 ^^^^%$n1c%
%= =%
^^^^^)^" %$n1c%
!§LOOPIf! /Eval: "RULE" %$n1c%
) ^&( %$n1c%
!@n2echo! FileOpen : '%%~^^^!' [OK] %$n1c%
)"
set FileOpen
for %%! in ( UserVARs ) do %FileOpen%
pause
set RULE
%@endoftest%
or:
Code: Select all
for %%? in ( FileOpen ) do set "%%~?=set "RULE=^>nul 2^>^&1reg delete "!$ED.Path!" /v "FileOpen" /f ^&^&( ^>nul 2^>^&1 reg query "!$ED.Path!" /v "FileOpen.%%~^^^!" ^&^&set /a ù = 1 ^|^|( set /a ù = 0 ^& for /f "tokens=1-4" %%b in ( " "!$ED.Path!" "FileOpen.%%~^^^!" "REG_SZ" "%E7%!Sub.^^^!Sub.Depth^^^!.Name%E7%!" " ) do ^^^!ERR.Chk.RegWrite.TokenSTR^^^! %()% ^>nul ^&echo.^>nul ) ^&for /f "tokens=1-4" %%b in ( " "!$ED.Path!" "FileOpen" "REG_SZ" "Ready" " ) do ^^^!ERR.Chk.RegWrite.TokenSTR^^^! %()% ^>nul ^&echo.^>nul ) ^|^|set /a ù = 1 ^&if %E7%!ù%E7%! neq 0 " ^&%LOOPIf% /Eval: "RULE" ^&( echo. ^&echo. ^&set /p "= FileOpen : '%%~^^^!' [OK]" <nul ) "
This is why I was hammering so much on the linefeeds.
We need to focus on debugging ben, we need linefeed AND indention AND delayed ( the ability to include other macro's )
I hope WHY has become clear to you now ( answering my own posts is a bit boring
).
This is the best I can do, if you see possibilities for making it look even nicer...