cq999 发表于 2008-9-28 09:18:15

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

我写有两个INI文件,第一个a.INI里面有

list=1001,1002,1003
第二个b.INI里面有

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
   $aa=$tt


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

[ 本帖最后由 cq999 于 2008-9-28 19:47 编辑 ]

liongodmien 发表于 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
   $aa=$tt
Next

cq999 发表于 2008-9-28 19:46:06

多谢,解决了
页: [1]
查看完整版本: 请问,应如何写判断语句?