使用下面的代码,其实你的注意if的用法
如果
if statement then expression
那么就没有else了,如果
if statement then
expression
else
expression
end if
也就看是否then 后面直接跟表达式
-------------------------------------------
[CODE]
-------------------------------------------
<%@ LANGUAGE=VBScript CodePage = 936%>
<%
Function getPro( ipro )
if ipro = 0 then getPro = "广东"
if ipro = 13 then getPro = "福建"
if ipro = 3 then getPro = "河北"
if ipro = 8 then getPro = "黑龙江"
if ipro = 16 then getPro = "河南"
if ipro = 17 then getPro = "湖北"
if ipro = 18 then getPro = "湖南"
if ipro = 19 then getPro = "广东"
if ipro = 10 then getPro = "江苏"
if ipro = 6 then getPro = "辽宁"
if ipro = 26 then getPro = "陕西"
if ipro = 23 then getPro = "四川"
if ipro = 2 then getPro = "天津"
if ipro = 11 then getPro = "浙江"
if ipro = 7 then getPro = "吉林"
if ipro = 22 then getPro = "重庆"
if ipro = 25 then getPro = "云南"
getPro = "全网"
END FUNCTION
%>
<%
Function getPro(ipro)
select case ipro
case 0
getPro = "广东"
case 2
getPro = "天津"
case 3
getPro = "河北"
case 6
getPro = "辽宁"
case 7
getPro = "吉林"
case 8
getPro = "黑龙江"
case 10
getPro = "江苏"
case 11
getPro = "浙江"
case 13
getPro = "福建"
case 16
getPro = "河南"
case 17
getPro = "湖北"
case 18
getPro = "湖南"
case 19
getPro = "广东"
case 22
getPro = "重庆"
case 23
getPro = "四川"
case 25
getPro = "云南"
case 26
getPro = "陕西"
case else
getPro = "全网"
end select
END FUNCTION
if iProvince=17 then
'-----^
getProvince="北京"
else
getProvince="上海"
end if
end function
语句没有什么错误啊。
那的看看你的iProvince是否正确了。
response.write cInt(iProvince)