【发布时间】:2010-02-04 15:58:01
【问题描述】:
有没有办法从经典 ASP 中的函数提前返回,而不是运行完整的函数长度?例如,假设我有这个功能......
Function MyFunc(str)
if (str = "ReturnNow!") then
Response.Write("What up!")
else
Response.Write("Made it to the end")
end if
End Function
我可以这样写吗...
Function MyFunc(str)
if (str = "ReturnNow!") then
Response.Write("What up!")
return
end if
Response.Write("Made it to the end")
End Function
请注意我在经典 ASP 中当然不能执行的 return 语句。有没有办法在返回语句所在的位置中断代码执行?
【问题讨论】:
标签: asp-classic