Ok, say I have the following array:
People = Array("Jim", "Bob", "Sam")
I know I need the third person in the array
I want to search my array for the third item and set text1.text = to "Sam"
How can I do this?
Thanks
-Jeremy
Printable View
Ok, say I have the following array:
People = Array("Jim", "Bob", "Sam")
I know I need the third person in the array
I want to search my array for the third item and set text1.text = to "Sam"
How can I do this?
Thanks
-Jeremy
Something like this?
VB Code:
For intLoopCounter = LBound(People) to UBound(People) If People(intLoopCounter) = "Sam" Then Text1.Text = People(intLoopCounter) End If Next intLoopCounter
If you know you need the third item then you would just say
Text1=Myarray(2)
Worth a mention :
The code provided will crap out if the array has not been initailized...
If you know you need the third item then you would just say
Text1=Myarray(2)
I declare the array in my Form_Load event. I think this is not working though as James said, because it works on some files and NOT others. Two files will have the same genre # assigned to them and one will read something like "Gothic Rock" , but the file right after it that has the SAME genre # will read "Progressive Rock". Progressive Rock follows Gothic Rock in the array. How can I fix this problem and read the CORRECT genre every time? Any help is appreciated.
It's like it get's confused or something.
Your 1st example doesn't quite describe exactly what you are trying to do...
Please explain a little more...are your trying to loop and "pull out" all Gothic Rock in the array? :confused:
I'm reading the genre field of and ID3v1.1 tag. The genre field of an ID3 v1.1 tag is only one byte. the way it works is a number is assigned to each genre, and that number corresponds to the genre name in an Array. So when I do this:
getid3.genre
This returns a number between 0 & 128. So in the Array, Classic Rock would be 1.
Ex.
Matrix = Array("Blues", "Classic Rock", etc.)
The problem is I'm using this code:
VB Code:
tmpgenre= getid3.genre i.subitems(5)=Matrix(tempGenre)
I'm looping through each listitem in a listview and assigning the Textname to the number. Does this make more sense now?
And since "Gothic Rock" is 91 and "Progressive Rock" is 92 it gets off by one occasionally. But if the number is 1 then it changes it correctly to "Classic Rock" So it gets confused or something going through the array. I need to fix this so it converts the number to the correct genre. Hope this makes more sense. Thanks for any help you can give.