China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

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!

中国DOS联盟论坛
The time now is 2026-08-07 17:05
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » What is this batch segment for? View 650 Replies 3
Original Poster Posted 2008-03-07 20:41 ·  中国 安徽 合肥 电信
初级用户
Credits 81
Posts 28
Joined 2007-08-27 17:14
18-year member
UID 95955
Gender Male
Status Offline
set a=☆☆☆☆☆☆☆☆☆☆
set b=★
set c=
set d=
set e=123456789abcde

:b
for /l %%a in (0,1,9) do (
set /a f=%random%%%14+1
set/p=!a:~%%a,1!<nul&set/p=%b%<nul
color 0!e:~%f%,1!
set/p=%c%<nul
if %%a equ 9 (set/p=%d%<nul&for /l %%a in (9,-1,1) do (set/p=!a:~-%%a!!<nul&set/p=%b%<nul&set/p=%d%<nul))
)
goto b

What does set/p=!a:~%%a,1! mean?
Floor 2 Posted 2008-03-07 20:43 ·  中国 北京 华为云
银牌会员
★★★
Credits 1,436
Posts 739
Joined 2007-10-11 17:44
18-year member
UID 99469
Gender Male
Status Offline
set/p=!a:~%%a,1!<nul
This is the whole thing.

This batch file is just for displaying a piece of text.
Floor 3 Posted 2008-03-07 20:44 ·  中国 安徽 合肥 电信
初级用户
Credits 81
Posts 28
Joined 2007-08-27 17:14
18-year member
UID 95955
Gender Male
Status Offline
I still don't quite understand. Then what does the part I cut out do?
Floor 4 Posted 2008-03-07 20:51 ·  中国 北京 华为云
银牌会员
★★★
Credits 1,436
Posts 739
Joined 2007-10-11 17:44
18-year member
UID 99469
Gender Male
Status Offline
Displays the variable a=☆☆☆☆☆☆☆☆☆☆ one by one

the five-pointed star in the middle
Forum Jump: