chiiren 发表于 2011-6-16 17:19:44

為何執行不起來

$hostname = "server111"
ip = "192.168.1.1"

For $x = 1 to 5
_build($x)
Next

Func _build($x)
        DllStructCreate("char hostname["& StringLen($hostname) &"];char ip[" & StringLen($ip) & "];ulong status")
        if @error Then
                MsgBox(0,"","在 DllStructCreate 內發生錯誤" & @error);
                exit
        endif
        DllStructSetData($x,"hostname","aaa")
        DllStructSetData($x,"ip","bbb")
        DllStructSetData($x,"status","ccc")
EndFunc

For $x =1 to 5
    ConsoleWrite(DllStructGetData($x,"hostname") & @CRLF & DllStructGetData($x,"ip") & @CRLF & DllStructGetData($x,"status") & @CRLF)
Next
页: [1]
查看完整版本: 為何執行不起來