![]() |
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-13 16:56 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS学习入门 & 精彩文章 (教学室) » Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime. Ask about the usage of ! |
| Printable Version 1,587 / 10 |
| Floor1 yardian | Posted 2006-10-20 22:38 |
| 中级用户 Posts 85 Credits 305 | |
|
This is code from an elder in the forum, but I don't know how to use it, so I've been unable to use it. Which expert can explain it? It's best to explain in detail things like:!num!,!ii:~0,1!. How is! used? This %ii:~0,1% can be found in set /?, but does it mean the same if it's changed to!ii:~0,1!? [ Last edited by yardian on 2006-10-21 at 00:16 ] |
|
| Floor2 yardian | Posted 2006-10-21 04:54 |
| 中级用户 Posts 85 Credits 305 | |
| Floor3 pengfei | Posted 2006-10-21 05:11 |
| 银牌会员 Posts 485 Credits 1,218 From 湖南.娄底 | |
|
You look at this paragraph which is easier to understand.
|
|
| Floor4 redtek | Posted 2006-10-21 07:46 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
There is also a stupid method: )
Use the pre - defined strings to be searched by you, Replace the same strings in the user - input content with them, Replace them with a flag character that is not easy or unlikely for the user to appear, Compare this character (replaced as the first character) with a pre - defined symbol (such as "氵"), If there is this symbol, it means that the replacement is successful, which means that the user - input content contains YES, If there is no this symbol, it means that the replacement is not successful, so it does not contain. …… [ Last edited by redtek on 2006 - 10 - 21 at 08:00 ] |
|
| Floor5 redtek | Posted 2006-10-21 07:58 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
Originally posted by yardian at 2006-10-20 22:38: %ii:~0,1% (meaning: take the first character of the %ii% variable, starting from offset 0) (its specific meaning needs to be queried in for /?, this FOR help is very comprehensive) (there are many kinds of usages, very many, a lot of words can't finish, need to run one by one according to the help to understand) For other contents, please query the following help information: SET /? FOR /? SETLOCAL /? IF /? Among them, FOR has detailed instructions on the use of the! symbol, but it also needs to be repeatedly understood and run and tested : ) Otherwise, it cannot be thoroughly understood : ) |
|
| Floor6 yardian | Posted 2006-10-21 11:09 |
| 中级用户 Posts 85 Credits 305 | |
Originally posted by pengfei at 2006-10-21 05:11 AM: |
|
| Floor7 vkill | Posted 2006-10-21 22:44 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
|
`setlocal /?` for a clearer view
|
|
| Floor8 redtek | Posted 2006-10-21 23:09 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
Originally posted by yardian at 2006-10-21 11:09: This ! and % can't be fully explained in a few sentences. The difference between ! and % and when to use them can't be intuitively determined, Not entirely because their help isn't clearly written, The main problem is: If there are complex assignments of various variables in SET, and values need to be passed during assignment. And if you encounter assigning values to variables in a for loop, and the values to be assigned are variables... A large number of variables are used inside and outside the FOR, assigning values to each other, passing values... There are also a large number of letter or variable separation operations, operating inside or outside the for... There are also differences between SET /A and SET A=B similar assignments, etc... And so on. If you usually only write a few batch processing or use them very little, Then the problem of! and % may not be encountered often, or if encountered, you don't know how to solve the problem of! and %, The main reason is: The above series of contents are interconnected. If you learn DOS too fast, you may have lost or not thoroughly studied before starting to compile more advanced contents. Jumping learning and too fast learning speed, and sometimes we often ignore the most basic contents such as SET FOR in order to save time, Resulting in the more you learn and apply later, the more proficient the basic knowledge points required are :) |
|
| Floor9 yeesong2002 | Posted 2006-10-21 23:17 |
| 新手上路 Posts 6 Credits 8 | |
|
Give it a support!
|
|
| Floor10 sglxy | Posted 2006-10-22 19:16 |
| 中级用户 Posts 87 Credits 397 | |
|
Support
|
|
| Floor11 zoub | Posted 2006-10-24 23:25 |
| 初级用户 Posts 6 Credits 20 | |
|
Take a close look...
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |