Board logo

标题: bat 变量的应用.不是很懂,谁给解释一下 [打印本页]

作者: lostangel     时间: 2008-3-9 23:47    标题: bat 变量的应用.不是很懂,谁给解释一下

@echo off
echo a=b+c
:hom
set/p a="a="
set/p b="b="
set/p c="c="

if %a%==? set/p a="a="<nul &set/a ?=%b%+%c%
if %b%==? set/p b="b="<nul &set/a ?=%a%-%c%
if %c%==? set/p c="c="<nul &set/a ?=%a%-%b%

echo %?%
goto hom


一共就这么多,各位给看一下哈!!!!
作者: HAT     时间: 2008-3-10 00:27
SET /A expression
SET /P variable=[promptString]

The /A switch specifies that the string to the right of the equal sign
is a numerical expression that is evaluated.

The /P switch allows you to set the value of a variable to a line of input
entered by the user.  Displays the specified promptString before reading
the line of input.  The promptString can be empty.