• Welcome to Valhalla Legends Archive.
 

simple question

Started by cRaPPy, July 12, 2004, 05:11 PM

Previous topic - Next topic

cRaPPy

I'm using cbs and wanted to add a whisper command button I added the following code:

Private Sub lvChannel_Click()
Dim strList As String
List = lvChannel.SelectedItem.Text
End Sub
Private Sub cmdWhisper_Click()
CleanSlateBot1.Send "/w " & strList & " " & txtsend.Text
txtsend.Text = ""
End Sub


[7:03:36 PM] That user is not logged on.

I'm guessing the username in the channel list is not being read, can someone help me fix my code so it does?

thx  ;D

Eli_1

#1
strList is a private variable - you cannot use it in another function.

Edit:
On a side note, you're never actually setting strList to anything.

Edit:
On another side note, I don't even see why a variable is needed.

Edit:
On another side note, I don't see how that compiles.  :-[

cRaPPy

#2
Thx for your help works now
Private Sub cmdWhisper_Click()
CleanSlateBot1.Send "/w " & lvChannel.SelectedItem.Text & " " & txtsend.Text
txtsend.Text = ""
End Sub

.... my first bot so I'm finding it exciting and been at in non stop and dont even know when the last time i slept was so I end up doing a lot of stupid stuff  :-\ but anyways yeah.. thx again  ;D

hismajesty

it's also allocating more values to memory than it needs to. :)