|
$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 |
|