If statement 如果没有,就不工作
下面是我代码中的“如果不是”部分:If statement 如果没有,就不工作,if-statement,batch-file,If Statement,Batch File,下面是我代码中的“如果不是”部分: :open set/p g=Choice: if %g%== 1 goto FNVEnd if %g%== 2 goto KSPEnd if %g%== 3 goto SKYPEEnd if not %g%==1|2|3 goto Correct2 :Correct2 cls echo Welcome. timeout 3 goto Open 除了“如果没有”部分,其他都正常工作,请帮助 你根本不需要那条线。如果用户没有输入1、2或3,则直接进入更正2 你
:open
set/p g=Choice:
if %g%== 1 goto FNVEnd
if %g%== 2 goto KSPEnd
if %g%== 3 goto SKYPEEnd
if not %g%==1|2|3 goto Correct2
:Correct2
cls
echo Welcome.
timeout 3
goto Open
除了“如果没有”部分,其他都正常工作,请帮助 你根本不需要那条线。如果用户没有输入1、2或3,则直接进入更正2 你确定另一个房间的空间合适吗 您可能想尝试以下方法:
:open
set/p g=Choice:
if "%g%"=="1" goto FNVEnd
if "%g%"=="2" goto KSPEnd
if "%g%"=="3" goto SKYPEEnd
REM If we get here ...
cls
echo Welcome.
timeout 3
goto Open
如果你试图在这里检查你是否得到了正确的答案,你已经做到了,失败将完成它 在这种情况下,如果THIS==THAT或THAT==THIS。。。 你必须使用IF,否则
REM :: AND
IF A==A IF B==B GOTO bothtrue
REM :: OR
IF A==A (
GOTO oneorother
) ELSE (
IF B==B GOTO oneorother
)
:bothtrue
ECHO Both were true.
GOTO EOF
:oneorother
ECHO AT least one was true.
发生了什么?错误意外输出?预期的输出和输出的输出是什么@USER2650307管道未在批处理中用作OR运算符。