找回密码
 加入
搜索
查看: 1774|回复: 2

请问,应如何写判断语句?

[复制链接]
发表于 2008-9-28 09:18:15 | 显示全部楼层 |阅读模式
我写有两个INI文件,第一个a.INI里面有
[aa]
list=1001,1002,1003  
第二个b.INI里面有
[bb]
1001=cc,dd
1003=ee,ff

代码:
$1=iniread(".\a.ini","aa","list","未知")
$list=StringSplit($1,",")
$Num = UBound($list)
for $f =1 to $Num -1 step 1
   $t=IniRead(".\b.ini","bb",$list[$f], "未知")
   $tt=StringSplit($t,",")
   $a=$tt[1]
   $aa=$tt[2]


当我一运行到,B.ini里面没有的1002时,就会出错,提示什么非数组出错,要怎么写才行?在VB6里我知道是用
if $list[$f] <>"" then可以,但在AU3里没用,不知要怎么写?

[ 本帖最后由 cq999 于 2008-9-28 19:47 编辑 ]
发表于 2008-9-28 17:48:53 | 显示全部楼层


Dim $1,$a,$aa,$f,$list,$Num,$t,$tt

$1=iniread(".\a.ini","aa","list","未知")
$list=StringSplit($1,",")
$Num = UBound($list)
for $f =1 to $Num -1 step 1
   $t=IniRead(".\b.ini","bb",$list[$f], "未知")
   If $t= "未知" Then ContinueLoop 
   $tt=StringSplit($t,",")
   $a=$tt[1]
   $aa=$tt[2]
Next
 楼主| 发表于 2008-9-28 19:46:06 | 显示全部楼层
多谢,解决了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-4 18:56 , Processed in 0.070936 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表