[已解决]请高手帮我看一下这段代码,为什么变量无法读取呢 (附AU3文件)
本帖最后由 elexy 于 2010-6-30 11:14 编辑在输入框里输入任意内容后点按钮,变量无法读取,请教高手如何解决???#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <RichEditConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("为什么变量不显示出来呢?", 300, 280)
$Button1 = GUICtrlCreateButton("写入文本", 150, 180, 60, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$sidin = GUICtrlCreateInput("",20,220,120,20)
$sid = GUICtrlRead($sidin)
While 1
$nMsg = GUIGetMsg()
Sleep(50)
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox(4096, "autoit", $sid)
$file = FileOpen("test.txt", 10)
FileWriteLine($file, "insert" & $sid & "痛苦")
FileClose($file)
EndSwitch
WEnd
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <RichEditConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("这样就显示出来了哦!", 300, 280)
$Button1 = GUICtrlCreateButton("写入文本", 150, 180, 60, 20)
$sidin = GUICtrlCreateInput("", 20, 220, 120, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Sleep(50)
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$sid = GUICtrlRead($sidin)
MsgBox(4096, "autoit", $sid)
$file = FileOpen("test.txt", 10)
FileWriteLine($file, "insert" & $sid & "痛苦")
FileClose($file)
EndSwitch
WEnd 新手!!学习了,谢谢!! 读取数据写错了 谢谢hnzzlzj ,问题解决!!!
页:
[1]