中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » [分享] MSDOS 7.1 里收藏的 ANSI.COM 演示批处理
作者:
标题: [分享] MSDOS 7.1 里收藏的 ANSI.COM 演示批处理 上一主题 | 下一主题
chishingchan
银牌会员




积分 1282
发帖 538
注册 2002-11-2
状态 离线
『楼 主』:  [分享] 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 点 ,下载次数: 26)
2009-10-31 20:57
查看资料  发短消息 网志   编辑帖子  回复  引用回复
ineedcomein
新手上路





积分 2
发帖 1
注册 2010-11-19
状态 离线
『第 2 楼』:  

ANSI.com的参数是什么

2010-11-20 10:28
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: