sirjaymz Posted October 21, 2008 Posted October 21, 2008 Here is a snippet of code I am trying to use in a form. I call this function from a SetOnevent for my combobox. CODE Func ComboRobotCmdSetChange() Local $search Local $done = 0 Local $a_RobotCmdSetFile Dim $a_RobotCmdSetArray[1] ; Shows the filenames of all Robotic control files in the current directory $search = FileFindFirstFile("Control -*.au3") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No Robot Control Files found.") Else While $done = 0 $a_RobotCmdSetFile = FileFindNextFile($search) If @error Then $done = 1 Else _ArrayAdd( $a_RobotCmdSetArray, $a_RobotCmdSetFile) EndIf WEnd GUICtrlSetData ($ComboRobot1CmdSet, $a_RobotCmdSetArray[0]&'|'&$a_RobotCmdSetArray[1], "None") ; Close the search handle FileClose($search) EndIf EndFunc ; ComboRobotCmdSetChange I do have a file name Control - Composer.au3, however, it never get's displayed in the combobox. what am i missing, or am i just not getting it?
Zedna Posted October 21, 2008 Posted October 21, 2008 Try something like this: Func ComboRobotCmdSetChange() ; Shows the filenames of all Robotic control files in the current directory $search = FileFindFirstFile("Control -*.au3") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No Robot Control Files found.") Else $data = '' While 1 $a_RobotCmdSetFile = FileFindNextFile($search) If @error Then ExitLoop $data &= $a_RobotCmdSetFile & '|' WEnd $data = StringTrimRight($data,1) ;~ ConsoleWrite($data & @CRLF) GUICtrlSetData($ComboRobot1CmdSet, $data, "None") ; Close the search handle FileClose($search) EndIf EndFunc ;==>ComboRobotCmdSetChange Resources UDF ResourcesEx UDF AutoIt Forum Search
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