|
POPASP快速入门第三课 使用var_export方法快速查看变量
因为asp的response.write不能输出数组类数据,这东西类似万能输出,有点像PHP的var_dump,如果你只记得dump,那你是学THINKPHP的^_^
- <!--#include file="../popasp_2.0/popasp.asp"-->
- <%
- const APP_PATH = "./home"
- POP_MVC.run
- Call A_("Index/index")
- %>
- <strong><%=V_("TIP")%></strong>
复制代码
IndexAction.class.asp
- <%
- ' 本类由系统自动生成,仅供测试用途
- Class IndexAction
- public Sub index()
- 'that.assign "TIP","hello popasp mvc"
- '使用Response.write方法就有点浪费时间了
- dim temp,key,arr,dict
- temp = "hello mvc"
- 'Response.write temp
- 'var_export temp
-
- temp = now()
- 'var_export temp '2017/1/12 22:22:41
-
- 'Request.ServerVariables
- 'Response.write typename(Request.ServerVariables) 'IRequestDictionary
- 'for each key in Request.ServerVariables
- ' Response.write key & ":" & Request.ServerVariables(key) & "<br />"
- 'next
- 'var_export Request.ServerVariables
-
- arr = array(1,2,3,4,5)
- 'var_export arr '[ 1, 2, 3, 4, 5 ]
-
- 'POP_MVC是POPASP_MVC类的实例,它是一个对象
- 'var_export POP_MVC '由四部分组成private_vars、public_vars、private_method、public_method
-
- 'that只能在action类中使用,它是POPASP_CONTROLLER类的一个实例化。
- 'var_export that
-
- '它还可以输出Recordset类型的变量
-
- 'Dictionary对象在VBScript语言中是最接近PHP语言的数组了。
- set dict = D_
- dict("a") = 111
- dict("b") = 222
- 'var_export dict '{ "a": 111, "b": 222 }
-
- var_export Me
- end Sub
- End Class
- %>
复制代码 |
|