anchor.diff:  :#   2013-11-12 JFL Added macros %IF_DEBUG% and %IF_VERBOSE%.                 #
   :#   2013-12-04 JFL Added variable %>DEBUGOUT% to allow sending debug output  #
   :#                  either to stdout or to stderr.                            #
  +:#   2015-10-29 JFL Added macro %RETURN#% to return with a comment.           #
  +:#   2015-11-19 JFL %FUNCTION% now automatically generates its name & %* args.#
  +:#                  (Simplifies usage, but comes at a cost of about a 5% slow #
  +:#                   down when running in debug mode.)                        #
  +:#                  Added an %UPVAR% macro allowing to define the list of     #
  +:#                  variables that need to make it back to the caller.        #
  +:#                  %RETURN% (Actually the Debug.return routine) now handles  #
  +:#                  this variable back propagation using the (goto) trick.    #
  +:#                  This works well, but the performance is poor.             #
  +:#   2015-11-25 JFL Rewrote the %FUNCTION% and %RETURN% macros to manage      #
  +:#                  most common cases without calling a subroutine. This      #
  +:#                  resolves the performance issues of the previous version.  #
  +:#   2015-11-27 JFL Redesigned the problematic character return mechanism     #
  +:#                  using a table of predefined generic entities. Includes    #
  +:#                  support for returning strings with CR & LF.		      #
  +:#   2015-11-29 JFL Streamlined the macros and added lots of comments.        #
  +:#                  The FUNCTION macro now runs with expansion enabled, then  #
  +:#                  does a second setlocal in the end as requested.           #
  +:#                  The RETURN macro now displays strings in debug mode with  #
  +:#                  delayed expansion enabled. This fixes issues with CR & LF.#
  +:#                  Added a backspace entity.                                 #
  +:#   2015-12-01 JFL Bug fix: %FUNCTION% with no arg did change the exp. mode. #
  +:#   2016-09-01 JFL Bug fix: %RETURN% incorrectly returned empty variables.   #
  +:#   2016-11-02 JFL Bug fix: Avoid log file redirection failures in recursive #
  +:#                  scripts.                                                  #
  +:#   2016-11-13 JFL Bug fix: Correctly return special characters & | < > ? *  #
  +:#   2016-11-24 JFL Fixed tracing %FUNCTION% arguments with ^ and % chars.    #
   :#                                                                            #
   :#----------------------------------------------------------------------------#
   
  
positive.code: :Debug.Off
  :Debug.0
  set "DEBUG=0"
  set "IF_DEBUG=if .%DEBUG%.==.1."
  set "FUNCTION=rem"
  set "RETURN=exit /b"
  set "EXEC.ARGS= %EXEC.ARGS%"
  set "EXEC.ARGS=%EXEC.ARGS: -d=%"
  set "EXEC.ARGS=%EXEC.ARGS:~1%"
  :# Optimization to speed things up in non-debug mode
  if .%LOGFILE%.==.NUL. set "ECHO.D=rem"
  if .%LOGFILE%.==.NUL. set "ECHOVARS.D=rem"
  goto :eof
  
  :Debug.On
  :Debug.1
  set "DEBUG=1"
  set "IF_DEBUG=if .%DEBUG%.==.1."
  set "FUNCTION=call :Debug.Entry"
  set "RETURN=call :Debug.Return & exit /b"
  set "EXEC.ARGS= %EXEC.ARGS%"
  set "EXEC.ARGS=%EXEC.ARGS: -d=% -d"
  set "EXEC.ARGS=%EXEC.ARGS:~1%"
  :# Reverse the above optimization
  set "ECHO.D=call :Echo.Debug"
  set "ECHOVARS.D=call :EchoVars.Debug"
  goto :eof
  
  :Debug.Entry
  %>DEBUGOUT% echo %INDENT%call :%*
  >>%LOGFILE% echo %INDENT%call :%*
  set "INDENT=%INDENT%  "
  goto :eof
  
  :Debug.Return
  %>DEBUGOUT% echo %INDENT%return !RETVAL!
  >>%LOGFILE% echo %INDENT%return !RETVAL!
  set "INDENT=%INDENT:~0,-2%"
  goto :eof
  
  :# Routine to set the VERBOSE mode, in response to the -v argument.
  :Verbose.Off
  
negative.code: :# If requested, convert the results back to a 2-digit format.
  if "%~3"=="-f" for %%c in (H M S MS) do if "!D%%c:~1!"=="" set "D%%c=0!D%%c!"
  if "!DMS:~2!"=="" set "DMS=0!DMS!"
  endlocal & set "DC=%DC%" & set "DH=%DH%" & set "DM=%DM%" & set "DS=%DS%" & set "DMS=%DMS%" & exit /b
  
  :#----------------------------------------------------------------------------#
  :#                                                                            #
  