循环数组问题
Dim $ljDim $lj1 = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\Chess"'
Dim $lj2 = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\FreeCell"'
Dim $lj3 = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\Hearts"'
Dim $lj4 = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\inkball"'
Dim $lj5 = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\Mahjong"'
Dim $lj6 = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\Minesweeper"'
Dim $lj7 = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\Purble Place"'
Dim $lj8 = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\Solitaire"'
Dim $lj9 = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\SpiderSolitaire"'
Dim $s = 1
For $i = $Checkbox1 to $Checkbox20 Step 1
If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
RunWait(@COMSPEC & " /c takeown /f " &$lj[$s]& " && icacls " &$lj[$s]& " /grant administrators:F ")
$s = $s + 1
EndIf
Next请教&$lj[$s]&这里应该如何写?这段代码就是在这里出错 Dim $lj,定义lj数组,只包含1个元素,在之后的引用中,只有$lj才是合法的数组取值。
Dim $lj =
Dim $lj
$lj = 1
$lj = 2
$lj = 3 ; 此句出错。 Dim $lj,定义lj数组,只包含1个元素,在之后的引用中,只有$lj才是合法的数组取值。
Dim $lj...
pusofalse 发表于 2010-3-3 22:30 http://www.autoitx.com/images/common/back.gif
留名,学习啦!:face (20): 本帖最后由 afan 于 2010-3-4 00:09 编辑
Dim $lj, $p = '"%SYSTEMDRIVE%\Program Files\Microsoft Games\', $s = 1
$lj = $p & 'Chess"'
$lj = $p & 'FreeCell"'
$lj = $p & 'Hearts"'
$lj = $p & 'inkball"'
$lj = $p & 'Mahjong"'
$lj = $p & 'Minesweeper"'
$lj = $p & 'Purble Place"'
$lj = $p & 'Solitaire"'
$lj = $p & 'SpiderSolitaire"'
For $i = $Checkbox1 To $Checkbox20 ;如果有20个复选框那 $lj 应定义 $lj,且应继续9以后的赋值
If GUICtrlRead($i) = $GUI_CHECKED Then
RunWait(@ComSpec & ' /c takeown /f ' & $lj[$s] & ' && icacls ' & $lj[$s] & ' /grant administrators:F ')
EndIf
$s += 1
Next 谢谢 3为仁兄。我先试试在说! 谢谢,学习了,数组就是这样的啊
,呵呵 谢谢,学习了,数组就是这样的啊
页:
[1]