Marius Posted July 16, 2005 Share Posted July 16, 2005 (edited) Hello! :"> I need help here. My GUI just won't open and read test.txt file. I need it to read file and use it on combo. $child = GUICreate("Pridėti naują usakymą", 300, 300, -1, -1, $WS_BORDER, -1, $1) $back2 = GUICtrlCreatePic ("newmark1.bmp", 0, 0, 300, 300) GuiCtrlSetState($back2, $GUI_DISABLE) GUISetState (@SW_SHOW) $naujascd = GUICtrlCreateCombo("", 10, 10, 275, 25) GUICtrlSetState($naujascd, $GUI_HIDE) GUICtrlSetState($naujascd, $GUI_SHOW) $end = GUICtrlCreateButton ("Baigti", 10,40 ,100, 25) FileOpen ( "test.txt", 0) $testcd = FileRead("test.txt") FileClose("test.txt") GUICtrlSetData($naujascd, $testcd) While 1 $msg2 = GUIGetMsg() If $msg2 = $end Then GUISetState(@SW_HIDE) GUIDelete() ExitLoop EndIf Wend Edited July 16, 2005 by Marius Marius back in da hood! :) Link to comment Share on other sites More sharing options...
quaizywabbit Posted July 16, 2005 Share Posted July 16, 2005 (edited) Hello! :"> I need help here. My GUI just won't open and read test.txt file. I need it to read file and use it on combo.I get this error.: ==> Incorrect number of parameters in function call.: $child = GUICreate("Pridėti naują usakymą", 300, 300, -1, -1, $WS_BORDER, -1, $1) $back2 = GUICtrlCreatePic ("newmark1.bmp", 0, 0, 300, 300) GuiCtrlSetState($back2, $GUI_DISABLE) GUISetState (@SW_SHOW) $naujascd = GUICtrlCreateCombo("", 10, 10, 275, 25) GUICtrlSetState($naujascd, $GUI_HIDE) GUICtrlSetState($naujascd, $GUI_SHOW) $end = GUICtrlCreateButton ("Baigti", 10,40 ,100, 25) $file =FileOpen ( "test.txt", 0) $testcd = FileRead($file) FileClose($file) GUICtrlSetData($naujascd, $testcd) While 1 $msg2 = GUIGetMsg() If $msg2 = $end Then GUISetState(@SW_HIDE) GUIDelete() ExitLoop EndIf Wend<{POST_SNAPBACK}>try that..... Edited July 16, 2005 by quaizywabbit [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
Marius Posted July 16, 2005 Author Share Posted July 16, 2005 $testcd = FileRead($file) $testcd = ^ ERROR Marius back in da hood! :) Link to comment Share on other sites More sharing options...
Marius Posted July 16, 2005 Author Share Posted July 16, 2005 (edited) Found solution: ;;;; ChildGUI $child = GUICreate("Pridėti naują usakymą", 300, 300, -1, -1, $WS_BORDER, -1, $1) $back2 = GUICtrlCreatePic ("newmark1.bmp", 0, 0, 300, 300) GuiCtrlSetState($back2, $GUI_DISABLE) GUISetState (@SW_SHOW) $naujascd = GUICtrlCreateCombo("", 10, 10, 275, 25) GUICtrlSetState($naujascd, $GUI_HIDE) GUICtrlSetState($naujascd, $GUI_SHOW) $lines = _FileCountLines($ftp) $newdata = FileReadLine($ftp, 1) GUICtrlSetData($naujascd, $newdata) For $i=2 To $lines $olddata = GUICtrlRead($naujascd) $newdata = FileReadLine($ftp, $i) GUICtrlSetData($naujascd, $olddata & $newdata) Next $end = GUICtrlCreateButton ("Baigti", 10,40 ,100, 25) While 1 $msg2 = GUIGetMsg() If $msg2 = $end Then GUISetState(@SW_HIDE) GUIDelete() ExitLoop EndIf Wend Edited July 16, 2005 by Marius Marius back in da hood! :) Link to comment Share on other sites More sharing options...
quaizywabbit Posted July 16, 2005 Share Posted July 16, 2005 haven't done much with file operations yet.....(back to da' help file ) [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
Marius Posted July 16, 2005 Author Share Posted July 16, 2005 Marius back in da hood! :) 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