User interface 为ComboBox永久设置变量?

User interface 为ComboBox永久设置变量?,user-interface,combobox,updates,autoit,User Interface,Combobox,Updates,Autoit,我正试图通过脚本永久更新组合框。假设我有一个叫 $myCombo = GUICtrlCreateCombo("Name", 296, 464, 169, 25) 还有一个按钮 $myButton = GUICtrlCreateButton("$000.00", 880, 380, 60, 20) 当按下“我的”按钮时,它会创建一个以组合框中的任何文本命名的文件 ; Pretend like this is in a loop Case $myButton $nameFile = GU

我正试图通过脚本永久更新组合框。假设我有一个叫

$myCombo = GUICtrlCreateCombo("Name", 296, 464, 169, 25)
还有一个按钮

$myButton = GUICtrlCreateButton("$000.00", 880, 380, 60, 20)
当按下“我的”按钮时,它会创建一个以组合框中的任何文本命名的文件

; Pretend like this is in a loop
Case $myButton
    $nameFile = GUICtrlRead($myCombo)
    $file = $nameFile & ".csv"
    if NOT FileExists($file) then
        _FileCreate($file)
        FileOpen($File, 1)
        FileWriteLine ( $File, $nameFile)

        GUICtrlSetData($myCombo,$nameFile & "|")
    EndIf

这将创建文件并更新GUI以在组合框中包含新文本,但我想永久更新组合。有没有办法更新它,使它即使在退出并重新启动脚本后也会有新数据?提前谢谢

在循环GUI循环之前,有一个文件用于创建文件列表

$cmbText = ""
$fileFileList = @ScriptDir & "\" & "filelist"
if FileExists($fileFileList) Then $cmbText = StringReplace(FileRead($fileFileList),@CRLF,"|")
GUICtrlSetData($myCombo,$cmbText)
在循环中,在case语句下,将$nameFile写入上面使用的文件列表中

If NOT FileExists($fileFileList) then
  _FileCreate($fileFileList)
EndIf
FileWriteLine($fileFileList,$nameFile)
GUICtrlSetData($myCombo,$nameFile & "|")