交易模型框架:用asp 写函数 返回值

来源:百度文库 编辑:高校问答 时间:2024/04/30 17:23:59
用asp写的函数返回一个值

function 函数名(参数) as 返回值类型[String|integer|……]
函数体
函数名=返回值
end function

VBScript

Function 函数名(参数1,参数2,...)

函数名=返回值 '函数名带回返回值
End Function
dim a
a = 函数名(函数名(参数1,参数2,...)

JavaScript
Function 函数名(参数1,参数2,...)
{
return(返回值); //带回返回值
}
var a;
a = 函数名(函数名(参数1,参数2,...);//注音区分大小写

'以下为一个把字符串中的'变为''的函数
function getStr(string1)

getStr=replace(string1,"'","''")

end function

例如:
str1="ssd'dsdsd'sdsd'sd"
str1=getStr(str1)
response.write str1
输出的结果为: ssd''dsdsd''sdsd''sd