[英]Batch File: Return to caller?
What is the equivalent of the return
statement for a batch file subroutine?批处理文件子例程的
return
语句等效于什么?
I think that it is:我认为是:
exit /b [exitCode]
Not just because it is more understandeable to use, but also because exit /b (and just exit also) may return an exitCode (ERRORLEVEL) value to the caller program.不仅因为它更易于使用,还因为 exit /b(也只是 exit)可能会向调用程序返回一个 exitCode (ERRORLEVEL) 值。
In my modest opinion, goto:eof is a strange patch that should not be used...在我看来,goto:eof 是一个不应该使用的奇怪补丁......
Goto :Eof
Exit
Goto:Eof usually use in call command such as: Goto:Eof 通常在调用命令中使用,例如:
@echo off
call :Hi
pause&exit
:hi
echo Hello!
goto :eof
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.