谁能帮忙解释ASP自定义函数

来源:百度知道 编辑:UC知道 时间:2024/06/19 08:36:57
<%
function openbottom(menuid,style)
dim sqlbo,strbo
SQLbo="select * from Sys_menu where Visible=true and menuid="&menuid&""
set strbo=objdb.RUNSQL_RETURN_RS(SQLbo)
if not strbo.eof then
if style=1 then
openbottom=Inkcar.inHTMLs(strbo("MenuContent"))
elseif style=2 then
openbottom=strbo("Menuname")
end if
end if
strbo.close:set strbo=nothing
end function
%>
请帮忙解释此段自定义函数

<%
function openbottom(menuid,style)
'自定义函数,有二个参数
dim sqlbo,strbo
SQLbo="select * from Sys_menu where Visible=true and menuid="&menuid&""
'根据传进来的参数,来动态生成SQL查询条件。
set strbo=objdb.RUNSQL_RETURN_RS(SQLbo)
'执行SQL语句,并返回值给数据集strbo
if not strbo.eof then
'如果不为空则
if style=1 then
'如果另一参数值为1则
openbottom=Inkcar.inHTMLs(strbo("MenuContent"))
'参数赋值,这是某一控件的标签值显示
elseif style=2 then
'如果值为2,则
openbottom=strbo("Menuname")
end if
end if
strbo.close:set strbo=nothing
'释放资源
end function
%>
目的好像就是动态改变某一控件的标签值。
调用时会写 openbottom(菜单ID,1)