Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 19:43

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



VB6 Subscript out of Range

Discussion on VB6 Subscript out of Range within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
Psycho Bär :D's Avatar
 
elite*gold: 12
Join Date: Jun 2008
Posts: 715
Received Thanks: 115
VB6 Subscript out of Range

Hey Leute,

fange gerade an mich bisschen mit Coden via VB6 zu beschäftigen hab auf Youtube erstmal zum anfang ein Hangman Tutorial angeguckt und bin grad dabei aber jetzt bekomm ich sobald ich Start drücke was zum debuggen:
Code:
Dim Ratewords(9) As String
Dim Rateword As String
Dim Keyword As String
Dim Letter As String
Dim lifelost As Boolean
Dim life As Integer
Dim gr As Integer
Dim kr As Integer
Dim zuf As Integer



Private Sub Command1_Click()
Letter = Text1.Text
Letter = UCase(Letter)
Text1.Text = ""
If Len(Letter) = 1 Then
    If Asc(Letter) > 64 And Asc(Letter) < 91 Then
    lifelost = True
    For i = 1 To Len(Rateword)
        If Mid(Letter, i, 1) = Letter Then
            Mid(Keyword, i, i) = Letter
            Label1.Caption = Keyword
            lifelost = False
            If Keyword = Rateword Then
            Box = MsgBox("You win Play again?", 36, "Win")
            
            
           End If
        End If
    Next
Else
    Box = MsgBox("Only tip in Letters, please", 0, "Error")
    End If
Else
    Box = MsgBoy("Please only tip in 1 Letter no more!", 0, "Error")
End If
Text1.SetFocus
End Sub

Private Sub Form_Load()
    Ratewords(1) = "SHOE"
    Ratewords(2) = "LEG"
    Ratewords(3) = "JAMES"
    Ratewords(4) = "NOSE"
    Ratewords(5) = "ICETEA"
    Ratewords(6) = "COMPUTER"
    Ratewords(7) = "HACKER"
    Ratewords(8) = "PEARLS"
    Ratewords(9) = "MUSIC"
    
    kl = 0
    gr = 9
    
    Randomize
    
    zuf = Int(Rnd + (gr - kl + 1)) + kl
    
  [COLOR="Red"]  Rateword = Ratewords(zuf)[/COLOR]
    
    For i = 1 To Len(Rateword)
        Keyword = Keyword + "-"
    Next
    
    Label1.Caption = Keyword
    
    life = 15
    
    Label2.Caption = life
        
        
End Sub

Private Sub Form_Unload(Cancel As Integer)
Box = MsgBox("Would you really like to Close it?", 36, "Closerequest")
    If Box = 6 Then

    Else
        Cancel = 1
        
    End If


End Sub
Das Geld markierte markt er mir an und sagt Ratewords(zuf) = <Subscript out of Range>

Wäre gut wenn jemand eine Antwort weiß und nett wenn er mir die lösung sagt:P
Psycho Bär :D is offline  
Old 05/20/2011, 21:55   #2
 
xNopex's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 827
Received Thanks: 471
Und inwiefern lernt man etwas dabei, wenn man dummdämlich den Code abtippt? Genau gar nicht.

Lösung deines Problems:
xNopex is offline  
Reply


Similar Threads Similar Threads
Range Tank with 30m gold range 95 mage 94
04/26/2011 - Runescape Trading - 11 Replies
Jo.Verkaufe meinen Range tank er hat noch member bis zum 26 Mai und die höchsten skills sind 95range und 94 mage :) er ist cb 93 (ohne summ 90 glaub ich) und ja mit dem kann man gut wildy Hier die stats http://i51.tinypic.com/21npr38.png Ich würde den Trade gerne mit paysafe card machen Ich wäre auch dazu bereit den trade über telefon laufen zu lassen sodass keine scam gefahr besteht. Ich verkaufe allerdings nicht unter 10€
Problem error: Subscript used whit non-Array variable "
08/26/2010 - Last Chaos - 1 Replies
hey leute, seitdem mein laptop ein windows update gemacht hat funktioniert der ultra bot nicht. es dann kommt immer die fehlermeldung " error: Subscript used whit non-Array variable " vor diesem update ging der bot noch.
[REQUEST] AutoIt select range/Grap Range For SRO!
02/11/2010 - Silkroad Online - 0 Replies
Can someone change this loader from private server loader to SRO loader?? :o
{Mabinogi} T> Infinite fb Range for 100%Range
01/08/2010 - Trading - 0 Replies
Hey..Trading infinite fireball range for 100%Range (Bow) IGN: Hollowclouds/Alexina Contact me: [email protected] Will except method or file...No keyloggers...not the ones from to mabinogi forum.



All times are GMT +2. The time now is 19:43.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.