Jump to content
Sign in to follow this  
ixxy

Simple looping question

Recommended Posts

ixxy

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!

Share this post


Link to post
Share on other sites
Jos

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ixxy

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?

Share this post


Link to post
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
Sign in to follow this  

×