mkmcst Posted June 26, 2009 Share Posted June 26, 2009 hi all is it posb to auto fil la combo from a text file can autoit do that i'm thinking i could use a FileReadLine and a set data i'm trying to get it so when i open the gui the combo is filled with the text in the file is this posb i'm not even sure i can do this or not ? thank you mike ^SLEEPY^sleepys-sin scripting Link to comment Share on other sites More sharing options...
colafrysen Posted June 26, 2009 Share Posted June 26, 2009 hi all is it posb to auto fil la combo from a text file can autoit do that i'm thinking i could use a FileReadLine and a set data i'm trying to get it so when i open the gui the combo is filled with the text in the file is this posb i'm not even sure i can do this or not ? thank you mike Check out this (Not tested) Dim $array $file = "Filename.ext" _FileReadToArray($file,$array) GUICtrlSetData($hControl,_ArrayToString($array)) [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
muncherw Posted June 26, 2009 Share Posted June 26, 2009 (edited) Sure, you can. ;This part goes above the gui $file = FileOpen("C:\list of goodies.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $listItems = $listItems & $line & "|" ;Don't forget the delimiter WEnd FileClose($file) ;create your gui then set the data GUICtrlSetData(-1, $listItems) I have a nice script that allows me to access various things on network PC's and I have multiple tabs that all read from the same txt file and display different info. Edited June 26, 2009 by muncherw Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
mkmcst Posted June 26, 2009 Author Share Posted June 26, 2009 Sure, you can. ;This part goes above the gui $file = FileOpen("C:\list of goodies.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $listItems = $listItems & $line & "|" ;Don't forget the delimiter WEnd FileClose($file) ;create your gui then set the data GUICtrlSetData(-1, $listItems) I have a nice script that allows me to access various things on network PC's and I have multiple tabs that all read from the same txt file and display different info. thank you i got it to work man was that hard for me to fig out for some reson i thought the GUICtrlSetData($Input_9,$listItems) had to be inside the loop but it thanks for helping me pull that off thank you to colafrysen ^SLEEPY^sleepys-sin scripting 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