Jump to content

Recommended Posts

Posted

I'm trying to load a text file into a GUICtrlCreateList. But the list appears empty, so this loop isn't working. Can anyone spot why?

Global $Filename = "C:\setm.m3u"
Dim $Array[1]
Dim $temp[1]

GUICreate("List GUI");

$list=GUICtrlCreateList ("", 25,10,350,97)
GUICtrlSetLimit(-1,200)

_FileReadToArray($Filename, $Array)
For $i=1 To $Array[0]
    _ArrayAdd($temp,GUICtrlSetData(-1,$Array[$i]))
Next

Which brings me to my second question; The text file happens to have paths for other files. Is it possible that when its displayed, I could double click on it to have it executed? (Multiple-line execution would be perfection)

Thanks!

  • Developers
Posted

should probably be something like:

GUICreate("List GUI");
$h_list = GUICtrlCreateList("", 25, 10, 350, 97)
GUICtrlSetLimit(-1, 200)
_FileReadToArray($Filename, $Array)
For $i = 1 To $Array[0]
    If $Array[$i] <> "" then GUICtrlSetData($h_list, $Array[$i])
Next

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

should probably be something like:

GUICreate("List GUI");
$h_list = GUICtrlCreateList("", 25, 10, 350, 97)
GUICtrlSetLimit(-1, 200)
_FileReadToArray($Filename, $Array)
For $i = 1 To $Array[0]
    If $Array[$i] <> "" then GUICtrlSetData($h_list, $Array[$i])
Next

Thanks Jos. It seems to be working now. Can anybody help me with the GUI part?

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
×
×
  • Create New...