johnmcloud Posted May 5, 2012 Share Posted May 5, 2012 (edited) Hi guys, i have this script: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 248, 180) $Edit = GUICtrlCreateEdit("", 8, 8, 233, 121) $Button = GUICtrlCreateButton("Verify", 8, 136, 233, 33) GUISetState(@SW_SHOW) GUICtrlSetData($Edit, "Number of lines (0)" & @CRLF & "Test1" & @CRLF & "Test2") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button $FinalList = StringSplit(GUICtrlRead($Edit), @CR) For $i = 2 To $FinalList[0] MsgBox(64, "Verify", $FinalList[$i]) Next EndSwitch WEnd I can't find a way for count the number of lines in a EditBox. I have see: _FileCountLines() FileReadLine But i can't apply directy to a EditBox without write them on a file and then EditBox read it. How to solve this? Thanks Edited May 5, 2012 by johnmcloud Link to comment Share on other sites More sharing options...
water Posted May 5, 2012 Share Posted May 5, 2012 Doesn't $FinalList[0] give you the number of lines? If not try to use$FinalList = StringSplit(GUICtrlRead($Edit), @CR, 1) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
johnmcloud Posted May 5, 2012 Author Share Posted May 5, 2012 Yes, but there is a problem: How to write the number of files without losing the data. There is a way to write the first line of a editbox without lose Test1 e Test2? Link to comment Share on other sites More sharing options...
water Posted May 5, 2012 Share Posted May 5, 2012 FileWrite("C:temptest.txt", $FinalList[1])? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
johnmcloud Posted May 5, 2012 Author Share Posted May 5, 2012 (edited) I don't want to write on a file if I wanted to write to the file I used _FileCountLines() The goal is: 1) GUICtrlSetData write the data ( Test1 e Test2 ) 2) I'll read the value and check the number of line with $FinalList[0] 3) GUICtrlSetData write the number of files ( $FinalList[0] ) and the data ( Test1 e Test2 ) on the EditBox [That's the problem] All this at startup of the GUI Edited May 5, 2012 by johnmcloud Link to comment Share on other sites More sharing options...
johnmcloud Posted May 5, 2012 Author Share Posted May 5, 2012 (edited) lol, i have the solution by myself: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 248, 180) $Edit = GUICtrlCreateEdit("", 8, 8, 233, 121) $Button = GUICtrlCreateButton("Verify", 8, 136, 233, 33) GUISetState(@SW_SHOW) $Test = "Test1" & @CRLF & "Test2" & @CRLF & "Test3" & @CRLF & "Test4" GUICtrlSetData($Edit, $Test) $FinalList = StringSplit(GUICtrlRead($Edit), @CR, 1) GUICtrlSetData($Edit, "Number of lines ( " & $FinalList[0] & ")" & @CRLF & $Test) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button $FinalList = StringSplit(GUICtrlRead($Edit), @CR) For $i = 2 To $FinalList[0] MsgBox(64, "Verify", $FinalList[$i]) Next EndSwitch WEnd Thanks water for support Edited May 5, 2012 by johnmcloud Link to comment Share on other sites More sharing options...
UEZ Posted May 5, 2012 Share Posted May 5, 2012 What about _GUICtrlEdit_GetLineCount() function?Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ 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