Board logo

标题: [分享] MSDOS 7.1 里收藏的 ANSI.COM 演示批处理 [打印本页]

作者: chishingchan     时间: 2009-10-31 20:57    标题: [分享] MSDOS 7.1 里收藏的 ANSI.COM 演示批处理

ANSI.COM 的教程不好找,好不容易找到一个演示程序:
@ECHO OFF
REM ANSIDEMO.BAT,  Version 2.00
REM Demonstrates the use of ANSI to control
REM text attributes and cursor positioning.
REM Written by Rob van der Woude
REM http://www.robvanderwoude.com

REM "" is the Escape character, "[" is the Escape character followed by "["
REM How they will be displayed completely depends on the editor/viewer or
REM browser you use and the selected codepage.

REM See http://www.robvanderwoude.com/ansi.html for a detailed description
REM of ANSI sequences.

ECHO Demo of ANSI sequences in batch filesCursor positioning...
FOR %%A IN (6 8 10 12 14 16 18 20) DO ECHO [%%A;%%AH%%A
PAUSE
ECHO Text attributes...
FOR %%A IN (8 10 12 14 16 18 20) DO ECHO [%%A;%%AH%%A
ECHO 
PAUSE
ECHO 
FOR %%A IN (0 1 2 3 4 5 6) DO ECHO [1%%A;1%%AH[0;3%%A;47mForeground color 3%%A
ECHO Foreground color 37
PAUSE
ECHO N O R M A L   F O R E G R O U N D
FOR %%A IN (0 1 2 3 4 5 6 7) DO %COMSPEC% /C FOR %%B IN (0 1 2 3 4 5 6 7) DO ECHO [1%%A;%%B1H[3%%A;4%%Bm 3%%A on 4%%B 
ECHO 
PAUSE
ECHO B R I G H T   F O R E G R O U N D
FOR %%A IN (0 1 2 3 4 5 6 7) DO %COMSPEC% /C FOR %%B IN (0 1 2 3 4 5 6 7) DO ECHO [1%%A;%%B1H[3%%A;4%%Bm 3%%A on 4%%B 
ECHO 
PAUSE
ECHO 0 = Normal text1 = Bright text
ECHO 2 = Bright attribute off? probably not, this hardly ever works
ECHO 4 = Underlined or blue5 = Blinking text or bright background
ECHO 7 = Reversed text8 = Invisible text (invisible, except on b/w screen prints)
ECHO 
PAUSE
ECHO 
ECHO.
ECHO As you probably noticed, all kind of "nonsense" is displayed on your screen.
ECHO You obviously need to load ANSI.SYS first and then run this demo again.
ECHO.
ECHO See http://www.robvanderwoude.com/ansi.html for more details
ECHO.
ECHO See http://www.robvanderwoude.com/ansi.html for more details
附件 1: ansidemo.zip (2009-10-31 20:57, 9.6 K, 下载附件所需积分 1点 ,下载次数: 24)

作者: ineedcomein     时间: 2010-11-20 10:28
ANSI.com的参数是什么