Joseph Posted October 4, 2008 Share Posted October 4, 2008 could someone point me in the right direction of how to get from a listbox and write that to a txt file? http://runecrue.awardspace.comhttp://demopros.awardspace.com Link to comment Share on other sites More sharing options...
Andreik Posted October 4, 2008 Share Posted October 4, 2008 #include <GUIConstants.au3> #Include <GuiListBox.au3> #region - GUI Create GUICreate('TEST',200,200) $LISTBOX = GUICtrlCreateList("",0,0,200,150) GUICtrlSetData($LISTBOX,"1|2|3|4|5|6|7|8|9") $SAVE = GUICtrlCreateButton("SAVE",80,165,40,20) GUISetState() #endregion #region - GUI SelectLoop While 1 $MSG = GUIGetMsg() Select Case $MSG = $GUI_EVENT_CLOSE Exit Case $MSG = $SAVE $DATA = "" $NUM = _GUICtrlListBox_GetCount($LISTBOX)-1 For $INDEX = 0 To $NUM $DATA &= _GUICtrlListBox_GetText($LISTBOX,$INDEX) & @CRLF Next $FILE= FileOpen(@ScriptDir & "\MYFILE.TXT",2) FileWrite($FILE,$DATA) FileClose($FILE) EndSelect WEnd #endregion When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Joseph Posted October 4, 2008 Author Share Posted October 4, 2008 ok how would i make it write from a list of a different program? http://runecrue.awardspace.comhttp://demopros.awardspace.com Link to comment Share on other sites More sharing options...
Zedna Posted October 4, 2008 Share Posted October 4, 2008 ok how would i make it write from a list of a different program? $LISTBOX = ControlGetHandle("Title","","ListBox1") rest will be the same Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Joseph Posted October 4, 2008 Author Share Posted October 4, 2008 thanks a lot ya'll, one more thing would be great, it writes the txt file as a list one under the other.. how could i make it write the list as each list data seperated by a comma? http://runecrue.awardspace.comhttp://demopros.awardspace.com Link to comment Share on other sites More sharing options...
Andreik Posted October 4, 2008 Share Posted October 4, 2008 thanks a lot ya'll, one more thing would be great, it writes the txt file as a list one under the other.. how could i make it write the list as each list data seperated by a comma?Replace @CRLF with a comma or other delimiter char. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now