Jump to content

Listing to a listbox my items, lists in the wrong order


Go to solution Solved by TurtlePower,

Recommended Posts

Hi Autoit Forum, I have an issue that has been hurting my head and I have no idea why it's happening or how to solve it... I am working on a function for my product organization program and I have ran into a barrier here.

I am trying to list each item of a text file, from the first line to the last, to a ListBox with the following code :

#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$List1 = GUICtrlCreateList("", 208, 96, 121, 200)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$lineCount = _FileCountLines("MugList2.txt")
$i = 1
Do
    $linea = FileReadLine("MugList2.txt",$i)
    _GUICtrlListBox_AddString($List1, $linea)
    $i = $i + 1
    Until $i = $lineCount

It lists the items to the ListBox, but not in order. Here is what it looks like :

 

image.png.1193f794a91aedc16ee014d42a97fbb1.png

 

Help would be greatly appreciated, hope you guys can help me figure out what is causing this bug

 

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...