AndySemi Posted July 22, 2021 Posted July 22, 2021 hello I'm trying to move all listbox items to a file. it works if there are few items.(~100 items) if there are ~ 800 items, the result will be ~ 400-700 or 0 what am I doing wrong? ; Script Start - Add your code below here #include <Constants.au3> #include <Array.au3> #include <GuiListBox.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #RequireAdmin $cHNW2 = WinActivate ("Symulacja NC") $cControlIDForti = ControlGetHandle($cHNW2, "" , "[CLASS:TListBox; INSTANCE:1]") $cControlIDFortiCount = _GUICtrlListBox_GetCount($cControlIDForti) ; Items count in the ListBox MsgBox (0,"",$cControlIDFortiCount) $file = FileOpen("E:\test.nc", 2) For $i = 1 To $cControlIDFortiCount FileWrite($file, _GUICtrlListBox_GetText($cControlIDForti, $i)) Filewrite($file,Chr(10)) Next FileClose($file)
Nine Posted July 22, 2021 Posted July 22, 2021 _GUICtrlListBox_GetText is 0-based. And put some error handling in the loop. For $i = 0 To $cControlIDFortiCount - 1 $iRet = FileWrite($file, _GUICtrlListBox_GetText($cControlIDForti, $i) & @CRLF) ConsoleWrite ($i & " = " & $iRet & @CRLF) Next “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
AndySemi Posted July 22, 2021 Author Posted July 22, 2021 ... 810 = 1 811 = 1 812 = 1 813 = 1 >Exit code: 0 Time: 20.66 ok all lines loaded I noticed that when I run the script in SciTe it works fine, but when I run the script from file MyScript.au3 or MyScript.exe then I don't get all the lines Overall, that's enough for me, it's not a problem to turn on SciTe every time
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