中国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-11-10 11:28
47,815 topics / 349,930 posts / today 0 new / 48,291 members
DOS批处理 & 脚本技术(批处理室) » [Original] Detailed Explanation of Variable Delay (Recommended for Beginners)
Printable Version  28,754 / 111
Floor76 plikefly Posted 2008-02-19 12:20
新手上路 Posts 7 Credits 13
Really learned a lot, also read the post of will Sort. Good stuff, this time I finally understand the variable expansion. Thanks
Floor77 windowsxphao Posted 2008-03-11 10:46
初级用户 Posts 14 Credits 25
The building owner has worked hard. This post is very useful for newbies like us, and we must support it a little bit.
Floor78 5872169 Posted 2008-03-11 10:48
高级用户 Posts 474 Credits 959
Collected, thank you, the landlord
Floor79 bat-zw Posted 2008-03-11 11:06
金牌会员 Posts 1,276 Credits 3,105
Originally posted by willsion at 2007-3-13 01:44:
Additionally, there is a question. I don't know if variable delay has side effects. If there are no side effects, then every program header can simply insert the setlocal EnableDelayedExpansion statement. Just like @echo off.

It should have side effects. I encountered it once when writing code (it was a mistake made by myself). As follows:
:begin
@echo off&setlocal EnableDelayedExpansion
.........................................
........................................
..........................................
goto begin
Originally, :begin was supposed to be placed after '@echo off&setlocal EnableDelayedExpansion'. But after running for a while, it always displayed that the setlocal had reached the maximum limit (I can't remember the original text). The variable delay in P also had errors and became invalid. Due to my limited level, I will stop here for narration. Everyone is welcome to express their opinions. The purpose is to learn and improve together.
Floor80 dslz666 Posted 2008-03-18 19:53
中级用户 Posts 117 Credits 233
Thanks to the LZ, after reading your post, I've learned a lot more.
Floor81 zsj008od Posted 2008-03-19 19:01
初级用户 Posts 12 Credits 28
Just solved my current problem:) Thank you. Previously, in the for, I used set /a n=%%f set /a m=n/16 set /a o=n%16... and couldn't get the correct result, but now it's fixed:)
Floor82 vivifier0923 Posted 2008-04-09 23:37
新手上路 Posts 1 Credits 2
Good stuff
Floor83 gao123 Posted 2008-04-10 14:36
新手上路 Posts 6 Credits 12
Floor84 jipinshangren Posted 2008-04-11 10:41
初级用户 Posts 62 Credits 120 From 四川内江
Thanks to the moderator, I seem to understand a little! I don't know if it means that those delays make echo and other assignment statements effective, and the assignment can be completed without being affected by the running commands of cmd! Still hope the moderator can give some guidance!
Floor85 tswcbyy Posted 2008-04-11 13:59
新手上路 Posts 7 Credits 14
Newcomer, not bad. Thanks
Floor86 joyn Posted 2008-05-06 23:50
中级用户 Posts 105 Credits 280 From 广西
I've been wandering in confusion~~ Now I can finally find my way out~~~
So classic~~
Thanks a lot
Floor87 stance Posted 2008-05-07 18:22
初级用户 Posts 46 Credits 64
Thank you very much, the original poster!

The explanation is very clear, hard work, hard work~~~
Floor88 jia332 Posted 2008-05-23 16:15
初级用户 Posts 81 Credits 160
Thank you very much, the problem that troubled me for 2 days has finally been solved. Also, thank you to the forum.
Floor89 hansom Posted 2008-05-28 00:36
初级用户 Posts 87 Credits 161
Floor90 wgx1688 Posted 2008-07-11 14:36
初级用户 Posts 34 Credits 60
===I need to look at it for a while to get a bit...
Prev  1 … 3 4 5 6 7 8  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023