|
gmy
版主
        操作系统爱好者
积分 1113
发帖 392
注册 2002-11-11
状态 离线
|
『楼 主』:
SET的难题
使用 LLM 解释/回答一下
SET a=1
SET b=2
SET c=a+b
如果这是BASIC, C的值就应该是3,但批处理就不行.
试过ASET,XSET,STRINGS都不行(它们只支持 数字直接运算)
请问,有没有其它小工具,可以解决"变量之间的运算"
SET a=1
SET b=2
SET c=a+b
In BASIC, the value of C would be 3, but batch processing can't do that.
I've tried ASET, XSET, STRINGS and none worked (they only support direct numeric operations)
Is there any other small tool that can solve "arithmetic operations between variables"?
|

DOS之家 http://doshome.com 站长 葛明阳 |
|
2004-7-4 00:00 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
如果是Windows 2000/xp/2003的dos方式,你可以使用:
set /a c=a+b
至于纯DOS环境,你可以使用Horst的varset。
If it is the DOS mode of Windows 2000/xp/2003, you can use:
set /a c=a+b
As for the pure DOS environment, you can use Horst's varset.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2004-7-5 00:00 |
|
|
gmy
版主
        操作系统爱好者
积分 1113
发帖 392
注册 2002-11-11
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
多谢,回家等我一试,
另外,CLIMBING?无忧的版主吧!久仰!
Thanks, going home to try it out.
Also, CLIMBING? It's the moderator of Wuyou! Long time no see!
|

DOS之家 http://doshome.com 站长 葛明阳 |
|
2004-7-5 00:00 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
gmy,其实STRINGS也是可以做到的,比如:
SET A=1
SET B=2
STRINGS C=ADD %A%,%B%
gmy, in fact, STRINGS can also be done, for example:
SET A=1
SET B=2
STRINGS C=ADD %A%,%B%
|

Wengier - 新DOS时代
欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/
E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)
 |
|
2004-7-6 00:00 |
|
|
gmy
版主
        操作系统爱好者
积分 1113
发帖 392
注册 2002-11-11
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
to Wengier
STRINGS C=ADD %A%,%B%
好像不行吧,我试了,如果是:
STRINGS C=ADD 1,2
可以。STRINGS不支持变量形式(%X%)
to Wengier
STRINGS C=ADD %A%,%B%
It doesn't seem to work. I tried. If it's:
STRINGS C=ADD 1,2
It's okay. STRINGS doesn't support variable forms (%X%)
|

DOS之家 http://doshome.com 站长 葛明阳 |
|
2004-7-9 00:00 |
|
|
gmy
版主
        操作系统爱好者
积分 1113
发帖 392
注册 2002-11-11
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
to Climbing
VARSET 成功!谢谢!具体步骤是:
set a=1
set b=2
call var set c=%a%,%b%
这时SET回车
C=3
### to Climbing
VARSET Success! Thank you! The specific steps are:
set a=1
set b=2
call var set c=%a%,%b%
Then press ENTER after SET
C=3
|

DOS之家 http://doshome.com 站长 葛明阳 |
|
2004-7-9 00:00 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
gmy,誰说STRINGS不支持变量形式?我在回帖前就做了一个实验,证明是绝对可行的才帖上来的。事实上,根本不存在STRINGS是否支持环境变量的问题,而是看DOS是否支持,因为输入后环境变量后DOS自动将环境变量转成其实际值并交给程序去使用,要么就是使用方法有误。注:我是在纯 MS-DOS 7.10命令行下测试的。
gmy, who said STRINGS doesn't support variable form? I did an experiment before replying, and it proved that it's absolutely feasible before posting it. In fact, there is no question of whether STRINGS supports environment variables at all, but it depends on whether DOS supports it, because after entering the environment variable, DOS automatically converts the environment variable into its actual value and hands it to the program for use, either because the usage method is wrong. Note: I tested it under the pure MS-DOS 7.10 command line.
|

Wengier - 新DOS时代
欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/
E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)
 |
|
2004-7-9 00:00 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
STRINGS是个什么命令,恕我孤陋寡闻,我是第一次见到这个命令,又学了一招!
是不是这个命令只能用在DOS 7.10下,我没有在2003的dos方式中发现这个命令,微软这东西怎么老变呢?
另外,我觉得还是varset比较通用一些,因为它可以用于任何DOS环境下。
STRINGS is what command? Forgive me for being ignorant, I'm seeing this command for the first time, and I've learned something new!
Is this command only usable under DOS 7.10? I didn't find this command in the DOS mode of 2003. Why does Microsoft keep changing things like this?
Also, I think varset is more universal because it can be used in any DOS environment.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2004-7-10 00:00 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
其实Strings和Varset一样,都是外部工具,而不是DOS自带的。只是Varset是Horst编的,而Strings则是Dunglas编的,且功能要多些。两者在网站的“脚本工具”中都有下载的。因为楼主在帖子中提到过Strings,所以我也就来说明Strings是可以做到的(Varset当然也可以做到)。
In fact, both Strings and Varset are external tools, not built-in with DOS. It's just that Varset was written by Horst, while Strings was written by Dunglas and has more functions. Both can be downloaded in the "Script Tools" section of the website. Since the LZ mentioned Strings in the post, I'll explain that Strings can do it (Varset can certainly do it too).
|

Wengier - 新DOS时代
欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/
E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)
 |
|
2004-7-10 00:00 |
|
|
fairsky007
初级用户
 
积分 21
发帖 8
注册 2010-8-24
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
strings 的确是好东西!!!
Strings are indeed great things!!!
|
|
2010-9-1 22:50 |
|