$Form1 = GUICreate("Form1", 362, 93, 192, 114)
$Input1 = GUICtrlCreateInput("请输入adcd的格式", 32, 24, 297, 21)
$Button1 = GUICtrlCreateButton("写入文本", 208, 64, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
dim $a,$b,$c,$d
$a=1
$b=2
$c=3
$d=4
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button1
$sr = GUICtrlRead($Input1)
$sr = StringReplace($sr,"a",$a)
$sr = StringReplace($sr,"b",$b)
$sr = StringReplace($sr,"c",$c)
$sr = StringReplace($sr,"d",$d)
FileWriteLine (@DesktopDir&"\test.txt",$sr)
EndSwitch
WEnd
将用户输入的abcd依次替换为变量$a,$b,$c,$d |