Function 是什么啊?? 下面这个什么意思啊 ?

来源:百度知道 编辑:UC知道 时间:2024/06/25 01:28:01
<%
Function safe(str)
str=Replace(str,"'","")
str=Replace(str,"-","")
str=Replace(str,"=","")
str=Replace(str,";","")
str=Replace(str,"'","")
str=Replace(str,"[","")
safe=trim(str)
End Function

Sub GetItemValue(ItemStr)
arrItem=split(ItemStr,",")
for each item in arrItem
execute(item+"=rs(""Sy_"+item+""")")
next
End Sub

Sub SetItemValue(ItemStr)
arrItem=split(ItemStr,",")
for each item in arrItem
execute("rs(""Sy_"+item+""")="+item)
next
End Sub

Sub GetFormValue(ItemStr)
arrItem=split(ItemStr,",")
for each item in arrItem
execute(item+"=Request.Form("""+item+""")&q

最上面的:replace就是转换的意思,Replace(str,"'","") 这个就是把str字符串里面的单引号换成空格,其他的类同,而trim则是去掉str两边的空格,后面的就有点乱了!不如你告诉我们这个程序是做什么的!到时候我们不就一清二楚了吗?我是说他实现什么功能!明白不??function就是过程函数的意思!

Function是定义一个函数
Function safe(str)
str=Replace(str,"'","") '将字符串str中的"'"置换为"",并付给str
str=Replace(str,"-","") '类似
str=Replace(str,"=","")
str=Replace(str,";","")
str=Replace(str,"'","")
str=Replace(str,"[","")
safe=trim(str) '去除字符串str左右的空格,付给safe
End Function