In a project I am currently working on I have a music directory with MP3s that will be use in the project. I also have a list box that will contain the above mentioned MP3s for selection if the user so desires. My problem is this. I want a dynamic list in the List box, rather than a static list of songs. That way I can reuse or add additional songs without having to worry about what is in the list box. I also have the list box hidden from view until such a time that the user wants to load a new song. Therein lies the problem. On a page show I have the application build a list and populate the list box and then hide the list box. Sometimes, if I have a lot of things going on on the computer, it will fail to load the songs into the list box if the list box is hidden before it can actually add the songs.
I am running XP on a 2G processor with 256 MB RAM. And it occasionally does this, I would say maybe one out of every 6-8 times. Other than making a static list does anyone have a suggestion on what to do to make sure the list box is populated before the list box is hidded. I am worried that the Educational PCs that this will be running on are definately slower than mine and I assume they will run into a similar problem more frequently.
Would a While loop work. I know that loops will run at different speeds on the PCs but what if I were to do something like this:
%Files% = GlobalList(playlist),GetItem (All)
<font color=blue>add</font color=blue>
ListBoxObject(ListBox1),AddFiles (Start, "%Files%")
%ItemCount% = ListBoxObject(ListBox1), GetProperty ("Item Count")
<font color=blue>IF (%ItemCount% = 0)</font color=blue>
GOTO ("add")
<font color=blue>END IF</font color=blue>
Page.HideObject("ListBox1")
Would that prevent the list box from being hidden until there was something in it? The Global list is created upon project initialization for automatic play of songs. I figured instead of doing another search for .mp3 I would utilize what was already there.
Or here is another:
%Files% = GlobalList(playlist),GetItem (All)
%ItemCount% = "0"
<font color=blue>WHILE (%ItemCount% = 0)</font color=blue>
ListBoxObject(ListBox1),AddFiles (Start, "%Files%")
%ItemCount% = ListBoxObject(ListBox1), GetProperty ("Item Count")
<font color=blue>END WHILE</font color=blue>
Page.HideObject("ListBox1")
Which do you think would be the best to populate a list box and hide it once it has the files listed in it. OR is there a better way that you could suggest to me.
Tigger
I am running XP on a 2G processor with 256 MB RAM. And it occasionally does this, I would say maybe one out of every 6-8 times. Other than making a static list does anyone have a suggestion on what to do to make sure the list box is populated before the list box is hidded. I am worried that the Educational PCs that this will be running on are definately slower than mine and I assume they will run into a similar problem more frequently.
Would a While loop work. I know that loops will run at different speeds on the PCs but what if I were to do something like this:
%Files% = GlobalList(playlist),GetItem (All)
<font color=blue>add</font color=blue>
ListBoxObject(ListBox1),AddFiles (Start, "%Files%")
%ItemCount% = ListBoxObject(ListBox1), GetProperty ("Item Count")
<font color=blue>IF (%ItemCount% = 0)</font color=blue>
GOTO ("add")
<font color=blue>END IF</font color=blue>
Page.HideObject("ListBox1")
Would that prevent the list box from being hidden until there was something in it? The Global list is created upon project initialization for automatic play of songs. I figured instead of doing another search for .mp3 I would utilize what was already there.
Or here is another:
%Files% = GlobalList(playlist),GetItem (All)
%ItemCount% = "0"
<font color=blue>WHILE (%ItemCount% = 0)</font color=blue>
ListBoxObject(ListBox1),AddFiles (Start, "%Files%")
%ItemCount% = ListBoxObject(ListBox1), GetProperty ("Item Count")
<font color=blue>END WHILE</font color=blue>
Page.HideObject("ListBox1")
Which do you think would be the best to populate a list box and hide it once it has the files listed in it. OR is there a better way that you could suggest to me.
Tigger
Comment