Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27350

creating classes and using them correctly

$
0
0
im not a very good v.net programmer, i programmed in java and c++ in school and rarely touched classes, so i dont really know much about them. i know how to create one, and barely how to call it. but thats it.
i want to paste this code in a class called "undo"

Code:

If Label48.Text = "Last drop: Coins" Then
            a(0) = a(0) - 1
            Label1.Text = CStr(str(0) + a(0))
            a(26) = a(26) - 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 30x Onyx bolt tips" Then
            a(1) = a(1) - 1
            Label2.Text = CStr(str(1) + a(1))
            a(26) = a(26) - 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 50x Grimy lantadymes" Then
            a(2) = a(2) - 1
            Label3.Text = CStr(str(2) + a(2))
            a(26) = a(26) - 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 10x Grimy torstols" Then
            a(3) = a(3) - 1
            Label4.Text = CStr(str(3) + a(3))
            a(26) = a(26) - 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 1x Magic seed" Then
            a(4) = a(4) - 1
            Label5.Text = CStr(str(4) + a(4))
            a(26) = a(26) - 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 1x Snapdragon seed" Then
            a(5) = a(5) - 1
            Label6.Text = CStr(str(5) + a(5))
            a(26) = a(26) - 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 1x Torstol seed" Then
            a(6) = a(6) + 1
            Label7.Text = CStr(str(6) + a(6))
            a(26) = a(26) + 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 120x Magic logs" Then
            a(7) = a(7) + 1
            Label8.Text = CStr(str(7) + a(7))
            a(26) = a(26) + 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 300x Yew logs" Then
            a(8) = a(8) + 1
            Label9.Text = CStr(str(8) + a(8))
            a(26) = a(26) + 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 30x Runite ores" Then
            a(9) = a(9) + 1
            Label10.Text = CStr(str(9) + a(9))
            a(26) = a(26) + 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 300x Coal and 50x Adamantite ores" Then
            a(10) = a(10) + 1
            Label11.Text = CStr(str(10) + a(10))
            a(26) = a(26) + 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 1x Dragon kiteshield" Then
            a(11) = a(11) + 1
            Label12.Text = CStr(str(11) + a(11))
            a(26) = a(26) * 0
            str(26) = str(26) * 0
            Label28.Text = CStr(str(26) + a(26)) * 0
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 5x Uncut dragonstones" Then
            a(12) = a(12) + 1
            Label13.Text = CStr(str(12) + a(12))
            a(26) = a(26) + 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 500x Death runes" Then
            a(13) = a(13) + 1
            Label14.Text = CStr(str(13) + a(13))
            a(26) = a(26) + 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 500x Blood runes" Then
            a(14) = a(14) + 1
            Label15.Text = CStr(str(14) + a(14))
            a(26) = a(26) + 1
            Label28.Text = CStr(str(26) + a(26))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 1x Royal torsion spring" Then
            a(15) = a(15) + 1
            Label16.Text = CStr(str(15) + a(15))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 1x Royal sight" Then
            a(16) = a(16) + 1
            Label17.Text = CStr(str(16) + a(16))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 1x Royal frame" Then
            a(17) = a(17) + 1
            Label18.Text = CStr(str(17) + a(17))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 1x Royal bolt stabiliser" Then
            a(18) = a(18) + 1
            Label19.Text = CStr(str(18) + a(18))
            Label27.Text = sum21(a)
        End If
        If Label48.Text = "Last drop: 1x Royal bolt stabiliser" Then
            a(18) = a(18) + 1
            Label19.Text = CStr(str(18) + a(18))
            Label27.Text = sum21(a)
        End If

i get this error: http://puu.sh/1JIep
and i really dont know why or so. also tried placing the forms name infront of the labels so they know where it comes from but it just says declaration expected.
so, how would i go around doing this?

Viewing all articles
Browse latest Browse all 27350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>