梁某人

发展才是硬道理

导航

vbscript变量的特点

 for each item in itemList
     dim showType
     if item.type <> "RMB" then showType = item.Type
next

当循环到了 item.type = "RMB" 的时候,showType竟然还是上一次循环的值。。。 dim showType竟然不能初始化变量了。。

这样就对了

 for each item in itemList
     dim showType  : showType = ""
     if item.type <> "RMB" then showType = item.Type
next


嗯。。我想vbscript的变量作用域是不能用语句块划分的。。

posted on 2005-04-14 18:08  涛仔28  阅读(478)  评论(0编辑  收藏  举报