Rather than saying that Brother Wunaihe's signature is amazing, it's better to say that Brother willsort's explanation is more wonderful…………=_=
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
DigestII
View 56,320 Replies 63
@echo off
findstr /n "^$" %1 >~tmp.shw
find ":" ~tmp.shw 1>nul 2>nul||del ~tmp.shw
set /A "turn=1"
for /f "usebackq delims=" %%l in (%1) do (
if exist ~tmp.shw call :space
set line=%%l
call :show
set /A "turn+=1"
echo.)
del ~tmp.shw
pause
goto :EOF
:show
setlocal EnableDelayedExpansion
for /l %%i in (0,1,9999) do (
if "!line:~%%i,1!"=="" goto :EOF
set /p= !line:~%%i,1!<nul
ping/n 1 127.1>nul
)
goto :EOF
:space
findstr "^%turn%:$" ~tmp.shw>nul && (
echo.
set /A "turn+=1"
goto :space
)
goto :EOF
Originally posted by yuanzijia08 at 2006-11-18 00:17:
@echo off & setlocal EnableDelayedExpansion
for /f "delims=" %%l in (%1) do (
set line=%%l
for /l %%i in (0,1,80) do (
Why can't this code handle characters like this! Don't say it's because of special characters, I hope to understand the internal reason for not being able to handle it, thank you
...
I love Beijing Tiananmen~: )
I love the great China~: )
I love all the pretty girls in great China~: )~
set /p==<nul
C:\TEMP>set /p==
The syntax of the command is incorrect.
C:\TEMP>set /p= =<nul
=
C:\TEMP>
@echo %dbg% off
:: Delay variable experiment~ : )
:: Enable delay variable
setlocal EnableDelayedExpansion
set "myname=abcdefg!!!!redtek"
echo Normal output: %myname%
echo Delay variable: !myname!
echo Can you see the symbols in the quotes? "!!!"
echo.
pause
echo.
echo.
:: Disable delay variable
setlocal disabledelayedexpansion
set "myname=abcdefg!!!!redtek"
echo Normal output: %myname%
echo Delay variable: !myname!
echo Can you see the symbols in the quotes? "!!!"
echo.
pause
