中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 14:24
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS学习入门 & 精彩文章 (教学室) » What is the difference between `for %i` and `for %a`?
Printable Version  4,739 / 22
Floor16 SinLow Posted 2009-09-17 13:03
初级用户 Posts 33 Credits 70
In the English 26 letters,
In FOR, they are all variables, and there is no difference.
Floor17 redrains Posted 2009-09-20 13:32
初级用户 Posts 26 Credits 49
What does the following "echo %+/%,/%-" mean?

Originally posted by lxmxn at 2008-1-6 12:48 AM:

There are definitely more than 26 symbols:



What does the following "echo %+/%,/%-" mean?
Floor18 terrywhut Posted 2009-10-17 14:26
新手上路 Posts 3 Credits 8
Originally posted by zhxy9804 at 2008-11-11 13:47:
Can you explain the meaning of the code on the seventh floor? I don't understand it, thank you! :(


Code on the seventh floor
for /f "tokens=1,3,4" %+ in ("hello world batch fans") do @echo %+/%,/%-

Read "hello world batch fans", split into individual tokens according to the space (default) delimiter, take the 1st, 3rd, and 4th tokens, and assign them to %+ %, %- respectively (because according to ASCII code values, 43 corresponds to +, 44 corresponds to ,, 45 corresponds to -). So %+ is hello %, is batch %- is fans

The final result is hello/batch/fans
Floor19 zhxy9804 Posted 2009-10-17 18:20
中级用户 Posts 97 Credits 208
Floor20 lving Posted 2009-10-25 09:06
新手上路 Posts 6 Credits 11
Floor21 xhlcy0322 Posted 2009-11-04 23:18
初级用户 Posts 39 Credits 55
Floor22 Portable Posted 2009-11-06 04:33
新手上路 Posts 6 Credits 11
Floor23 f319 Posted 2009-11-10 01:02
新手上路 Posts 9 Credits 14
Learned, it seems that it should be done in ascending order of ASCII. As for the statement that there are only 26 letters, I have also seen it, maybe it's a problem with different Windows versions.
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023