Sir Topham Hatt Posted March 10, 2011 Author Share Posted March 10, 2011 I am having so much troble with this bit of code. Says I did not define a varible. May I have some insight on this and what it means. Also how does this work? Sorry I have no idea how to program in VB 6.>! Private Sub imgButton_Click(Index As Integer)Dim Buffer As clsBufferDim i As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Select Case Index Case 1 If Not picInventory.Visible Then ' show the window picInventory.Visible = True picCharacter.Visible = False picSpells.Visible = False picOptions.Visible = False picParty.Visible = False picQuests.Visible = False BltInventory ' play sound PlaySound Sound_ButtonClick End If Case 2 If Not picSpells.Visible Then ' send packet Set Buffer = New clsBuffer Buffer.WriteLong CSpells SendData Buffer.ToArray() Set Buffer = Nothing ' show the window picSpells.Visible = True picInventory.Visible = False picCharacter.Visible = False picOptions.Visible = False picParty.Visible = False picQuests.Visible = False ' play sound PlaySound Sound_ButtonClick End If Case 3 If Not picCharacter.Visible Then ' send packet SendRequestPlayerData ' show the window picCharacter.Visible = True picInventory.Visible = False picSpells.Visible = False picOptions.Visible = False picParty.Visible = False picQuests.Visible = False ' play sound PlaySound Sound_ButtonClick ' Render BltEquipment BltFace End If Case 4 If Not picOptions.Visible Then ' show the window picCharacter.Visible = False picInventory.Visible = False picSpells.Visible = False picOptions.Visible = True picParty.Visible = False picQuest.Visible = False ' play sound PlaySound Sound_ButtonClick End If Case 5 If Not picQuests.Visible Then ' show the window picInventory.Visible = False picCharacter.Visible = False picSpells.Visible = False picOptions.Visible = False picParty.Visible = False picQuests.Visible = True ' play sound PlaySound Sound_ButtonClick End If Case 6 If myTargetType = TARGET_TYPE_PLAYER And myTarget <> MyIndex Then SendTradeRequest ' play sound PlaySound Sound_ButtonClick Else AddText "Invalid trade target.", BrightRed End If Case 7 ' show the window picCharacter.Visible = False picInventory.Visible = True picSpells.Visible = False picOptions.Visible = False picParty.Visible = False picQuests.Visible = False ' play sound PlaySound Sound_ButtonClick End Select ' Error handler Exit Suberrorhandler: HandleError "imgButton_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub Link to comment Share on other sites More sharing options...
goku1993 Posted March 10, 2011 Share Posted March 10, 2011 what does it highlight? Link to comment Share on other sites More sharing options...
Sir Topham Hatt Posted March 11, 2011 Author Share Posted March 11, 2011 picQuests.Visible = False Link to comment Share on other sites More sharing options...
shadowwulf Posted March 11, 2011 Share Posted March 11, 2011 and picQuests exists and has a field for true/false? Link to comment Share on other sites More sharing options...
Sir Topham Hatt Posted March 11, 2011 Author Share Posted March 11, 2011 It has one of those picture objects like options, character ones have. Maybe I need to name it right? Link to comment Share on other sites More sharing options...
shadowwulf Posted March 11, 2011 Share Posted March 11, 2011 if it isnt named "picQuests" then yes… that would cause an error..When writing the line "picQuests." it should pop up a dropdown with all the options in it and 'Visible' should be there. Link to comment Share on other sites More sharing options...
Sir Topham Hatt Posted March 11, 2011 Author Share Posted March 11, 2011 Okay thanks man, found the problem I missed an s in one of them. Gosh I feel like the biggest idiot in the world. Anyways thanks. Link to comment Share on other sites More sharing options...
shadowwulf Posted March 11, 2011 Share Posted March 11, 2011 least you didnt spent 8 hours before realizing you forgot to out in the last line saying to make your variable equal something… Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now