App freezes after loading files

Hello,
Need help.

how can I rid myself of a window that loads 12 celestial catalogs?
Each time I open the window I have to wait 8 seconds until
load all objects in file.dat. Each catalog have an average of three thousand lines
It stops all the windows of my application for 8 seconds when reading.

Thanks,
Rui

[code]e = GetFolderItem(“Libs\GC.dat”)
stream = e.openastextfile

while not stream.eof
s() = split(stream.readline,",")
simple_panel.combobox3.AddRow s(0)
simple_panel.combobox3.text = “NGC”
wend[/code]

You could move that file loading routine into a thread…

Thanks Marc.

Except that your code updates the UI, so it can’t go in a thread. You might try moving the line

simple_panel.combobox3.text = "NGC"

Outside the loop. No need to do that on every line.

You certainly could use a thread if the thread loads all of the data into an array and then use a timer to periodically poll the array and load the new items into the combobox.

hello.

Thanks for the solutions. Yes you are right Tim :slight_smile:

Rui