|
qzwqzw
银牌会员
     天的白色影子
积分 2343
发帖 636
注册 2004-3-6
状态 离线
|
『第 31 楼』:
使用 LLM 解释/回答一下
我在editplus里设置了一个快捷输入!
啥都不说了,知音难觅啊
I set up a quick input in EditPlus!
Nothing more to say, it's hard to find a kindred spirit!
|
|
2008-6-25 22:39 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 32 楼』:
使用 LLM 解释/回答一下
几次看见 ping/n 1 127.1, 我知道这个命令的本来意思,但用在类似于这样的代码起到了什么作用,能否给我这个土鸟解释下。
谢谢!
I've seen the command `ping/n 1 127.1` several times. I know the original meaning of this command, but what role does it play in code like this? Can you explain it to a newbie like me?
Thanks!
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-6-25 22:42 |
|
|
metoo
初级用户
 
积分 195
发帖 93
注册 2006-10-28
状态 离线
|
『第 33 楼』:
使用 LLM 解释/回答一下
Originally posted by qzwqzw at 2008-6-25 10:38 PM:
人一多就显得有些乱了
再加上有几位喜欢编辑帖子的
看着看着就觉得思路连不上了
现在理顺一下
ppdos开始只是想简化楼主的代码
后来提出无奈 ...
鄙人的开始观点已经意识到错误了,基本统一楼上观点,
但是我认为ppdos的简写方式是不对的
Originally posted by qzwqzw at 2008-6-25 10:38 PM:
It gets a bit chaotic when there are too many people
Plus there are a few who like to edit posts
After reading for a while, the train of thought gets disconnected
Now let's sort it out
ppdos initially just wanted to simplify the LZ's code
Then raised the helplessness...
My initial view has realized the mistake, basically unified the above - floor view,
But I think the abbreviated way of ppdos is incorrect
|
|
2008-6-25 22:43 |
|
|
metoo
初级用户
 
积分 195
发帖 93
注册 2006-10-28
状态 离线
|
『第 34 楼』:
使用 LLM 解释/回答一下
Originally posted by qzwqzw at 2008-6-25 10:39 PM:
啥都不说了,知音难觅啊
<img src="images/smilies/face-grin.png" align="absmiddle" border="0">哈哈,知音难觅,居然还有同好的
Originally posted by qzwqzw at 2008-6-25 10:39 PM:
Nothing to say, hard to find bosom friends啊
:lol:Haha, hard to find bosom friends, there are actually people with the same interest
|
|
2008-6-25 22:44 |
|
|
metoo
初级用户
 
积分 195
发帖 93
注册 2006-10-28
状态 离线
|
『第 35 楼』:
使用 LLM 解释/回答一下
Originally posted by quya at 2008-6-25 10:42 PM:
几次看见 ping/n 1 127.1, 我知道这个命令的本来意思,但用在类似于这样的代码起到了什么作用,能否给我这个土鸟解释下。
谢谢!
搜索论坛关于批处理运行时间延迟方面的帖子
Originally posted by quya at 2008-6-25 10:42 PM:
Several times I saw "ping/n 1 127.1", I know the original meaning of this command, but what role does it play in code like this? Can you explain it to me, a novice.
Thanks!
Search the forum for posts about batch processing runtime delay aspects
|
|
2008-6-25 22:47 |
|
|
PPdos
高级用户
   
积分 783
发帖 268
注册 2006-12-26
状态 离线
|
『第 36 楼』:
使用 LLM 解释/回答一下
关于缩成一行的代码 个人而言
是为了能更方便的在dos命令行中直接测试
个人觉得很有必要 测试程序并非多余
(只是我手懒 能一行写出来的都不想建个批文件)
Regarding the code condensed into one line Personally speaking It is to be able to test directly in the DOS command line more conveniently Personally, I think it is necessary The test program is not redundant (just I'm lazy and don't want to create a batch file if it can be written in one line)
|

菩提本无树,明镜亦非台,本来无一物,何处惹尘埃. |
|
2008-6-25 22:51 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
|
2008-6-25 22:51 |
|
|
wxcute
中级用户
  
积分 458
发帖 211
注册 2006-7-26
状态 离线
|
『第 38 楼』:
使用 LLM 解释/回答一下
刚才居然中毒了,不知道是哪个可恶的家伙。很郁闷阿。
另editplus好用吗?原来有这样的好东东。用notepad习惯了,可是累阿,要改改。下载个先。
Just got poisoned just now, don't know which hateful guy did it. Very depressed.
Another thing, is EditPlus good? There are such good things originally. Used to using Notepad, but it's tiring. Need to change. Download one first.
|

┌───────┐
├→学习→实践→┤
└───────┘ |
|
2008-6-25 23:19 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 39 楼』:
使用 LLM 解释/回答一下
Originally posted by wxcute at 2008-6-25 11:19 PM:
刚才居然中毒了,不知道是哪个可恶的家伙。很郁闷阿。
另editplus好用吗?原来有这样的好东东。用notepad习惯了,可是累阿,要改改。下载个先。
大家以后中毒并且杀毒软件杀不了的话,可以找我。
我老土批处理虽然不行,可是手工杀毒的本事那是天下无双啊。
Originally posted by wxcute at 2008-6-25 11:19 PM:
Just got poisoned just now, don't know which hateful guy did it. Very depressed.
Also, is EditPlus good? There are such good things. Used to using Notepad, but it's tiring. Need to change. Download one first.
If everyone gets poisoned later and the antivirus software can't kill it, you can find me.
My old-fashioned batch processing may not work, but my ability to manually remove viruses is unparalleled in the world.
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-6-26 10:11 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
|
2008-6-26 10:35 |
|
|
hjkk123
初级用户
 
积分 160
发帖 82
注册 2007-5-14
状态 离线
|
|
2008-6-26 10:55 |
|
|
qzwqzw
银牌会员
     天的白色影子
积分 2343
发帖 636
注册 2004-3-6
状态 离线
|
    『第 42 楼』:
使用 LLM 解释/回答一下
看来大家都缺乏彻底的实践精神啊!
讨论了这半天
只有经过了测试才发现ppdos以及zh159精简代码的大问题
因为他们所有的代码都经不起多次运行的考验
第一次运行结果都是对的
比如是7
但第二次运行结果却出错
本来应该是14,结果却仍然是7
第三次仍然错了,本来是21,结果却是14
也就是说在没有设置setlocal的变量环境下
环境变量是会随着运行次数递增的
但是call echo出来的却总是for执行之前的结果
除非call echo的变量此句代码运行前是空
最后的到的结论是
在连接语句中是无法完全用 call echo %var% 代替 echo !var! 的
所以我在26楼中间那段中所表明的最后论点是错的
当然这并不影响我在30楼提到的观点
for+call是可以完全替代for+延迟
至于40楼的代码除了以上提到的共性问题外
思路上也绕了弯子
想不显示set /a只需要一个@标记就可以了
用不着祭起echo off这把牛刀
(for /f %i in ('dir /b') do @set /a n+=1 >nul)&call echo 目录下有%n%
但是我仍然申明
这种缩写很没有意思
先执行for再执行echo %n%
既简单又清晰
还不会出现我所说的上述问题
何苦来哉!
It seems that everyone lacks thorough practical spirit!
After discussing for so long, only after testing was it discovered that there are major problems in ppdos and the simplified code of zh159. Because all their codes can't stand the test of multiple runs.
The result of the first run is correct, for example, it's 7. But the result of the second run is wrong. It should be 14, but it's still 7. The third time is still wrong. It should be 21, but it's 14.
That is to say, in the environment where setlocal is not set, the environment variables will increase with the number of runs. But what is called and echoed out is always the result before the for execution. Unless the variable called and echoed is empty before this code runs.
The final conclusion is that it's impossible to completely replace echo!var! with call echo %var% in the connection statement
So the final argument I showed in the middle of building 26 is wrong.
Of course, this doesn't affect the view I mentioned in building 30. for+call can completely replace for+delay
As for the code in building 40, in addition to the common problems mentioned above, the idea also takes a detour. To not display set /a, only a @ mark is needed. There's no need to bring out the big gun of echo off.
(for /f %i in ('dir /b') do @set /a n+=1 >nul)&call echo There are %n% under the directory
But I still declare that this kind of abbreviation is very meaningless. Execute for first and then echo %n%, which is simple and clear, and won't have the above problems I mentioned. Why bother!
|
|
2008-6-26 13:58 |
|
|
metoo
初级用户
 
积分 195
发帖 93
注册 2006-10-28
状态 离线
|
『第 43 楼』:
使用 LLM 解释/回答一下
Originally posted by qzwqzw at 2008-6-26 01:58 PM:
看来大家都缺乏彻底的实践精神啊!
讨论了这半天
只有经过了测试才发现ppdos以及zh159精简代码的大问题
因为他们所有的代码都经不起多次运行的 ...
对头,精简代码是错误的,仅仅相当于一个for完成后再echo一下
而楼主的代码确实可以带替延迟变量
可以看下我的27楼回复的代码,那个call和楼主的 call完全是两种不同的用法
Originally posted by qzwqzw at 2008-6-26 01:58 PM:
It seems that everyone lacks the spirit of thorough practice!
After discussing for so long
Only after testing did we discover the major problems of ppdos and the simplified code of zh159
Because all their codes cannot withstand multiple runs...
That's right, simplifying the code is wrong, which is just like echoing once after a for loop is completed
And the code of the original poster can indeed replace the delayed variable
You can take a look at the code in my reply at floor 27. That call and the original poster's call are completely two different usages
|
|
2008-6-26 15:21 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 44 楼』:
使用 LLM 解释/回答一下
确实忘了在set/a前使用@
1、在命令行里使用,如果你不清空变量,下次的结果肯定会递增,这你不会不知道!
2、在命令行里使用,如果单纯的for后再来一个echo,那是两次输入命令(先输入一次for回车后再输入echo)。
PS:能不用call跳转最好不要用,对效率有一定的影响
Indeed, I forgot to use @ before set/a.
1. When using in the command line, if you don't clear the variable, the result next time will definitely increase, and you shouldn't be unaware of this!
2. When using in the command line, if there is simply a for followed by an echo, that's two commands entered (first enter the for and press Enter, then enter echo).
PS: It's best not to use call jump if possible, as it has a certain impact on efficiency.
|

 |
|
2008-6-26 16:17 |
|
|
plp626
银牌会员
     钻石会员
积分 2278
发帖 1020
注册 2007-11-19
状态 离线
|
|
2008-6-26 18:53 |
|