| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 512 人关注过本帖
标题:【求助】vbs问题
只看楼主 加入收藏
弓虽人
Rank: 1
来 自:江苏南通
等 级:新手上路
帖 子:19
专家分:0
注 册:2008-11-9
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:2 
【求助】vbs问题
程序运行后弹出个vbs对话框,点取消后出现数组越界


flag=&h200
whichone=openfile("choose a file","c:\","Everything|*.*|Text Files|*.txt|Word-Documents|*.DOC",2,flag)
msgbox "raw data returned:"&whichone

whichone=split(whichone," ")
path=whichone(0)
filecount=ubound(whichone)
if filecount=0 then
        msgbox "you selected one file:"&whichone(0)
        msgbox "returned flag:"&flag
        if(flag and 1) then
                msgbox "readonly selected"
        else
                msgbox "readonly not selected"
        end if
        if(flag and 1024) then
                msgbox "selected file is not txt file!"
        else
                msgbox "selected file is of default type!"
        end if
else
        msgbox "you selected "&filecount&" files!"
        for x=1 to ubound(whichone)
                list=list&path&whichone(x)&vbcr
        next
        msgbox list
end if

function openfile(title,dir,filter,index,flags)
        set comdlg=createobject(")
        comdlg.filter=filter
        comdlg.filterindex=index
        comdlg.flags=flags
        comdlg.maxfilesize=260
        comdlg.cancelerror=false
        comdlg.dialogtitle=title
        comdlg.initdir=dir
        comdlg.defaultext="txt"
        comdlg.showopen
        openfile=comdlg.filename
        flags=comdlg.flags
end function
搜索更多相关主题的帖子: vbs 
2009-07-26 13:43
jrs123
Rank: 2
等 级:论坛游民
威 望:1
帖 子:627
专家分:14
注 册:2006-9-5
收藏
得分:7 
顶一下
2009-07-29 11:09
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:7 
这有什么好问的,直接查为什么数组越界呀。
2009-07-29 11:39
快速回复:【求助】vbs问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017235 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved