【发布时间】:2013-10-10 23:58:52
【问题描述】:
所以我正在尝试编写一个基本的计算机程序。而且我在某些语法上遇到了一些麻烦。代码如下。
@echo off
cls
color 71
:start
echo -----------------------------------
echo Welcome to Tandy's Calculator! v0.1
echo -----------------------------------
echo Enter your first number below
echo Type "help" to see the list of available commands
echo -----------------------------------
set /p "_input1=Please Enter The First Number or Command:"
cls
goto subroutine
:subroutine
:: the below line gives me the "goto was unexpected at this time" error
if /i "%_input1%"=="help" goto help1
if /i "%_input1%"=="back" goto _input1
if /i "%_input1%"=="clear" goto clearVar (
goto checkVar
)
每次执行文件时都会收到错误消息 “此时 goto 出乎意料”,命令窗口关闭。
使用暂停命令,我已经能够查明我收到错误消息的程序部分。程序中已对此进行了注释。
谁能帮助我?我的语法有什么问题?
【问题讨论】:
标签: batch-file cmd goto