asp经典 – 早期从经典ASP中的函数返回
发布时间:2020-12-15 23:16:37 所属栏目:asp.Net 来源:网络整理
导读:有没有办法从经典ASP中的函数提前返回,而不是运行函数的全长?例如让我说我有这个功能… Function MyFunc(str) if (str = "ReturnNow!") then Response.Write("What up!") else Response.Write("Made it to the end") end ifEnd Function 我可以这样写吗 Fun
有没有办法从经典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语句的位置? 解决方法
是使用退出功能.
Function MyFunc(str) if str = "ReturnNow!" then Response.Write("What up!") Exit Function end if Response.Write("Made it to the end") End Function 我通常在从函数返回值时使用它. Function usefulFunc(str) ''# Validate Input If str = "" Then usefulFunc = "" Exit Function End If ''# Real function ''# ... End Function (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 如何循环通过WebForms中的数据,就像在MVC中
- ASP.NET-MVC.如何从URL获取控制器名称?
- ASP.NET(AJAX+JSON)实现对象调用
- asp.net – 当onclientclick为false时,停止onclick触发?
- asp.net – 什么设置的User.Identity.Name和User.Identity.
- asp.net – 如何将新的Web应用程序部署到IIS站点的子目录,而
- asp.net – 按顺序匹配的字段数量生成SQL顺序
- asp.net – ‘response.clear()’删除内容和标题?
- ASP.NET无法访问IIS元数据库
- asp.net-mvc – 条件数据注释
推荐文章
站长推荐
- 如何在Asp.net中调用webmethod C#
- asp.net – 在Web.Config的Location Path元素中指
- asp.net – 正常与云/ Azure托管和SQL Azure与SQ
- 回发后的ASP.Net无法找到指定的URL
- asp.net-mvc-3 – MVC3 – 使用Entity框架设置Co
- asp.net-mvc – 在ASP.NET MVC中的NHibernate会话
- asp.net-mvc – ASP.NET MVC – Routes和UrlHelp
- asp.net – Web身份验证状态 – 会话vs Cookie v
- asp.net-web-api – 如何在Swashbuckle中替换Swa
- ASP.NET Web应用程序体系结构/模式
热点阅读