this script completely runs
Code: Select all
:SetEchoBack
@setlocal
@ :: Liest ob ECHO ON oder OFF geschalten ist um Variablen zu setzen
@(
echo>"%temp%\isOn.Ft"
for /f "usebackq tokens=2 delims=()" %%E in ("%temp%\isOn.FT") do @set "EchoBack=echo %%E &"
del "%temp%\isOn.Ft"
set prompt=$G$S
)
) some tests
echo off
if defined debug echo on
(echo hallo in der Klammer
::
rem in der Klammer & weiter hier
rem )^
echo hinter rem Klammer
:etwas geschrieben & weiter gehts
echo abc
)
echo hinter der Klammer zu
(((
rem
)))
(
:rem
:
) ,;=
echo hinter der leeren Klammer
) (@echo Klammer zu hinter LEVEL 0
rem neue Klammer auf
(
@^
) & ,;=)
) ,;=) ,;=) ,;=) pause
) ^
) &echo) 0&
,;=)
,;= ) & <ReadNotThisFile >notCreated && :no Mark || not Executed " " set echo xy | echo nothing
)
) define LF as a Line Feed (newline) character
(
set ^"LF=^
" ) Above empty line is required - do not remove
) &echo rem this will check for correct closing
:: define a newline with line continuation
set ^"\n=^^^%LF%%LF%^%LF%%LF%^^"
rem this will END from 0 to 30 Parenths
set PE30=@(@%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%
) %\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%
) %\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%)%\n%
)
set ^"\A=)^^^&@set/ax+=1^^^%LF%%LF%^%LF%%LF%^^"
rem this will END from 0 to 100 Parenths (or many to) and check failNumber
@set PE=@(@%\n%)%\n%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%%\A%
)^&@set/ax+=1
call call call call set ")=^^^^^" &rem create 80x
set ^)=@(@%\n%)%\n%
%):^=2^>nul set/aX+=1)^|^|set/aX-=1^&%
set x=0
echo vor den klammern
(((
(
%=;) ( abcdefg )=%
(
%PE% &echo nothing
echo %x% ^) missing
),;=)
) &)
set x=0
(((((
(((((
rem 10 klammern
(((((
rem 15 klammern
(((((%)% %)%
echo %x%
set x=0
(((((((((((((((((((((((((((((((((
%)%
echo %X%
set x=0
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
for /f %%i in ("1 2 3 4 5 6 7") do %)% %)%
echo %x%
set x=0
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
(((((((((((((((((((((((((((((((((((((((
(((((((((((((((((((((((((((((((((((((((((((
for /l %%i in (1 1 20 ) do %pe%
%pe%&%pe%&%pe%
echo %x%
,;=) & ,;=) & ,;=) & ,;=) & ,;=) & ,;=) & ,;=) & ,;=) & ,;=) & ,;=)
)= & echo xyz
) @^
) @^
) @^
echo 3at
set "END=call ) &"
(
((
rem in Drei geoeffneten Klammern
echo xyz
%PE30% nothing to do
((
rem zwei geoeffnete Klammern
) &call ) & echo rem "" ^^ ^^ ^^ ^^ vier doppelte Escape ) &call )
(
rem eine geoeffnete Klammer
rem check
call echo " 1^ 2^^ 3^^^" ^^
call call echo " 1^ 2^^ 3^^^" ^^
call call call echo " 1^ 2^^ 3^^^" ^^ )
%PE30%
) rem keine Anzeige
) rem keine 2. Anzeige
echo vor dem Schluss
echo a^
b c^
) & echo ^"extraZeile^
echo keine extra Zeile
%PE%
set x=0
(((((((((( (((((((((( (((((((((( (((((((((( (((((((((( ((((((((((
for /l %%l in (1 1 10) do (echo %%l
for /l %%x in (1 1 2) do %PE%
%PE30% &%PE30%&
echo %x% ^) Missing
:checkCMDline
:: setzt eine Variable CMDPause wenn im Batchmodus
@echo off
setlocal disabledelayedexpansion
rem CMD-Kontex ?
set "CMDPause=%~f0"
set "CMDPause=%CMDPause:\=\\%"
set "CMDPause=%CMDPause:.=\.%"
setlocal enabledelayedexpansion
for /f delims^= %%i in ("!CMDcmdLine!") do endlocal &set "CMDPin=%%i"
cmd /von /c "echo !CMDPin!" |findstr /irc:"cmd .*\/c \"\"%CMDPause%\" .*\"" /c:"cmd\.exe .*\/c \"\"%CMDPause%\" .*\"" >nul
endlocal
echo on
if not errorlevel 1 set "CMDPause=pause &"
if errorlevel 1 set "CMDPause="
%EchoBack%
%CMDPause% exit /b
:checkEchoOn
%= @rem :: Liest ob ECHO ON oder OFF geschalten ist um Variablen zu setzen =%
@(
rem ^%Mon% Zeilen bei Echo on auf REM umschalten
echo>"%temp%\isOn.Ft"
< "%temp%\isOn.Ft" find "ON" >nul && set "Mon=rem" || set "Mon=echo("
del "%temp%\isOn.Ft"
exit /b
%PE%
the number of the round Clips (Parenth ?) is determined in single lines without error.
The number is worked [%X%] out, thus this can be created the Script with the right number.
Phil