• Welcome to Valhalla Legends Archive.
 

Element Not Found

Started by Tazo, August 09, 2004, 02:29 PM

Previous topic - Next topic

Tazo

I'm getting element not found when i do

Private Sub oscarSock_loggedOut(strFormattedName As String)
lstUsers.ListItems.Remove strFormattedName
End Sub

and to raise it,

              Case 4                    
                   pData 2, getTLV(strData, 1) 'store formatted name
                   A1 = Split(getTLV(strData, 5), ":", 2)
                   pData 3, getTLV(strData, 6)
                   pData 4, getTLV(strData, 17)
                   Winsock1(1).Close
                   Winsock1(1).Connect A1(0), A1(1)
                   RaiseEvent loggedOut(CStr(getTLV(strData, 1)))

Whats wrong? I even tried the lstusers part with parenthesees, still nothing

CrAz3D

You are supposed to remove users by an index, not a string.  You are trying to remove them by a string.
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Tazo

does that mean I have to add each one with an index?

Eli_1

Note: People who know me, know that I have a hard time expressing things in words. I'll try my best to explain it, but bare with me.


Think of it more as an array.

Dim Blah(9) as String

That has a total of 10 different elements (0-9), and 10 different indexes.

Suppose each one of those (Blah(0) - Blah(9)) contains a person's name. One of them is "laurion." How would you search through that array and find the index that corresponds with that name? Most likely, you would use some kind of loop, and compare each element in the array to the name you're searching for to find the correct index which holds that name.

The same could be applied to a listview. Each name you see on a channel list has it's own corresponding index. To remove an item from that listview, you need to pass the index you want removed to the Remove function.

MyndFyre

#4
Quote from: Eli_1 on August 09, 2004, 09:20 PM

Dim Blah(9) as String

That has a total of 10 different elements (0-9), and 10 different indexes.
Actually, no -- that has a total of 10 different elements, and ten different indices.  The indices are 0-9 -- the elements are not.  The elements are referenced to by the indices as appropriate (and really, the elements are not referenced directly by numerical indices, but by the size of offset of one element to the next times the index into the array, but who's counting?)

The rest was right though :)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Eli_1

Oops, thanks for correcting my wrong information.  ;D

MyndFyre

Quote from: Eli_1 on August 09, 2004, 11:58 PM
Oops, thanks for correcting my wrong information.  ;D

I got yer back.  I'm your support.  Just call me bra.  Er, bro.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

ChR0NiC

Don't forget we kind of discussed this matter here

Newby

Quote from: laurion on August 09, 2004, 02:29 PM
I'm getting element not found when i do

Private Sub oscarSock_loggedOut(strFormattedName As String)
lstUsers.ListItems.Remove strFormattedName
End Sub

Should be something like:

Private Sub oscarSock_loggedOut(strFormattedName As String)
   listUsers.ListItems.Remove(listUsers.FindItem(strFormattedName).Index)
End Sub
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.