条件语句问题,求助

fp2003 2006-10-27 08:12:59
各位同志,我遇到一个问题,怪啊,代码如下,请帮看下到底哪错了,谢了:
----------
response.write "类型值为:"&sca_type
if sca_tpye="1" then bgc1="FF9933" else bgc1="FF6600" end if
if sca_tpye="2" then bgc2="FF9933" else bgc2="FF6600" end if
response.write "bgc1:"&bgc1
response.write "bgc2:"&bgc2
---------
运行结果:
类型值为:1
bgc1:FF6600bgc2:FF6600bgc3

类型值为:2
bgc1:FF6600bgc2:FF6600bgc3
------------求助...
好像不管sca_type的值为什么,条件语句都不成立,求大侠们帮看下
引号去掉sca_tpye=1这样写效果也一样,实在看不出哪儿有问题。
...全文
85 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
飘零雾雨 2006-10-28
  • 打赏
  • 举报
回复
解决了,JF!
fp2003 2006-10-28
  • 打赏
  • 举报
回复
多谢上面两位大侠我
sca_type=cstr(trim(request("sca_type")))
if sca_type="1" then bgc1="FF9933" else bgc1="FF6600" end if
这样写没有效果
if cstr(trim(request("sca_type")))="1" then bgc1="FF9933" else bgc1="FF6600" end if
把它合并成一句就行了,晕...
zmhqyw 2006-10-27
  • 打赏
  • 举报
回复
response.write "类型值为:"&sca_type
if trim(cstr(sca_tpye)) = "1" then
bgc1="FF9933"
else
bgc1="FF6600"
end if
stou 2006-10-27
  • 打赏
  • 举报
回复
trim(sca_tpye)="1" 試下

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧