Author Topic: The General Chatter Thread.  (Read 1596734 times)

Offline Scourge of teh Galaxy

  • Giga Heavyweight
  • Posts: 6428
  • Rep: 0
  • Where do folks go when they die?
    • http://www.facebook.com/b
    • houndoomrulz
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: houndoomrulz
Re: General Chatter Thread
« Reply #30400 on: March 13, 2012, 10:30:33 AM »
Hey guys, how's it going?

I'm having a little bit of trouble with Visual Basic.

I'm trying to work an array with a variable, you know, like name(i), i having a value that gets set at the beginning

But, to do a For loop to loop for the number of times equal to i, I called up another element, n. n is an integer like i

The lecture slides say it's okay to do this. In fact, here's its example:


For i = 1 to num_tracks
   names(i) = InputBox(“Name of track ” & i)
   times(i) = InputBox(“Time for track ” & i)
   total_time = total_time + times(i)
Next

next to my current code for this part:

        For n = 1 To i
            'Get runner's name
            '====================
            name(n) = InputBox("Input runner " & n & "'s name")

            'Get a time for each lap
            '====================
            lap1(n) = InputBox("Input the time for " & name(n) & "'s first lap")
            lap2(n) = InputBox("Input the time for " & name(n) & "'s second lap")
        Next


I run a debug test and it gives me an IndexOutOfRangeException and says "Index was outside the bounds of the array"


Here's my full code, btw


Public Class Form1

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        '====================
        'Coursework 2012 Program
        'by Student 09001219
        '08/03/2012
        '====================

        'Calling elements and arrays
        '====================
        Dim valid As Boolean
        Dim i As Integer
        Dim n As Integer
        Dim name(i) As String
        Dim lap1(i) As Integer
        Dim lap2(i) As Integer

        'Get valid number of runners
        '====================
        valid = False
            While valid = False
                i = InputBox("Input a number between 2 and 8")
                If i >= 2 Then
                    If i <= 8 Then
                        valid = True
                    End If
                End If
        End While

        'Loop for number of runners
        '====================
        For n = 1 To i
            'Get runner's name
            '====================
            name(n) = InputBox("Input runner " & n & "'s name")

            'Get a time for each lap
            '====================
            lap1(n) = InputBox("Input the time for " & name(n) & "'s first lap")
            lap2(n) = InputBox("Input the time for " & name(n) & "'s second lap")
        Next
        MsgBox("This is one of those boxes you get that proves you've got this far without issue")
    End Sub
End Class
Showcase     Wiki     deviantART     tumblr

Offline D3M0NCHR15

  • Antweight
  • Posts: 10
  • Rep: 0
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30401 on: March 13, 2012, 10:32:43 AM »
Hey guys, how's it going?

I'm having a little bit of trouble with Visual Basic.

I'm trying to work an array with a variable, you know, like name(i), i having a value that gets set at the beginning

But, to do a For loop to loop for the number of times equal to i, I called up another element, n. n is an integer like i

The lecture slides say it's okay to do this. In fact, here's its example:


For i = 1 to num_tracks
   names(i) = InputBox(“Name of track ” & i)
   times(i) = InputBox(“Time for track ” & i)
   total_time = total_time + times(i)
Next

next to my current code for this part:

        For n = 1 To i
            'Get runner's name
            '====================
            name(n) = InputBox("Input runner " & n & "'s name")

            'Get a time for each lap
            '====================
            lap1(n) = InputBox("Input the time for " & name(n) & "'s first lap")
            lap2(n) = InputBox("Input the time for " & name(n) & "'s second lap")
        Next


I run a debug test and it gives me an IndexOutOfRangeException and says "Index was outside the bounds of the array"


Here's my full code, btw


Public Class Form1

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        '====================
        'Coursework 2012 Program
        'by Student 09001219
        '08/03/2012
        '====================

        'Calling elements and arrays
        '====================
        Dim valid As Boolean
        Dim i As Integer
        Dim n As Integer
        Dim name(i) As String
        Dim lap1(i) As Integer
        Dim lap2(i) As Integer

        'Get valid number of runners
        '====================
        valid = False
            While valid = False
                i = InputBox("Input a number between 2 and 8")
                If i >= 2 Then
                    If i <= 8 Then
                        valid = True
                    End If
                End If
        End While

        'Loop for number of runners
        '====================
        For n = 1 To i
            'Get runner's name
            '====================
            name(n) = InputBox("Input runner " & n & "'s name")

            'Get a time for each lap
            '====================
            lap1(n) = InputBox("Input the time for " & name(n) & "'s first lap")
            lap2(n) = InputBox("Input the time for " & name(n) & "'s second lap")
        Next
        MsgBox("This is one of those boxes you get that proves you've got this far without issue")
    End Sub
End Class

erm...  :baby_smily:... :idea2:.........nope it's gone............ah who am I kidding? I HATE PROGRAMMING...... I CAN NEVER UNDERSTAND IT (give me 2 years on a project then I'll be sussed)

Offline Incredirobotwars

  • Ultra Heavyweight
  • Posts: 2402
  • Rep: 1
  • Unimaginative reuse of original avatar FTW
    • http://www.facebook.com/#
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: dwatts.irw
Re: General Chatter Thread
« Reply #30402 on: March 13, 2012, 11:11:20 AM »

I run a debug test and it gives me an IndexOutOfRangeException and says "Index was outside the bounds of the array"


Here's my full code, btw


Public Class Form1

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        '====================
        'Coursework 2012 Program
        'by Student 09001219
        '08/03/2012
        '====================

        'Calling elements and arrays
        '====================
        Dim valid As Boolean
        Dim i As Integer
        Dim n As Integer
        Dim name(i) As String
        Dim lap1(i) As Integer
        Dim lap2(i) As Integer

        'Get valid number of runners
        '====================
        valid = False
            While valid = False
                i = InputBox("Input a number between 2 and 8")
                If i >= 2 Then
                    If i <= 8 Then
                        valid = True
                    End If
                End If
        End While

        'Loop for number of runners
        '====================
        For n = 1 To i
            'Get runner's name
            '====================
            name(n) = InputBox("Input runner " & n & "'s name")

            'Get a time for each lap
            '====================
            lap1(n) = InputBox("Input the time for " & name(n) & "'s first lap")
            lap2(n) = InputBox("Input the time for " & name(n) & "'s second lap")
        Next
        MsgBox("This is one of those boxes you get that proves you've got this far without issue")
    End Sub
End Class

OK, start by removing that messagebox that's there to prove it's there. A far simpler way is to click on the grey tab to the side of each line of code where you want it to make sure it's at. The line will turn red when it's highlighted. What will then happen is the program will pause, the code will show, and you can check it's there and/or hover the mouse over variables to check their values.

Now, I would suggest doing this at any point where there is an 'n' integer or 'i' integer in that line of code. When the program stops at each line, check the values of the integers in this line to make sure they don't equal something out of range (eg. 0, -1, etc.). If they do, a '+1' needs to go somewhere, or a value somewhere in the code needs to be changed.

If the problem isn't one of the values being out of the array's defined range, then PM me the code with the debugged line highlighted, and I'll see if something else is amiss.

EDIT: I feel so stupid now. Your array needs to be defined as between certain values, eg. names(1 to 8)
(sorry I didn't notice this. I was too busy playing Skyrim...)

Offline GoldenFox93

  • Giga Heavyweight
  • Posts: 12161
  • Rep: -5
  • The Guy
    • http://www.facebook.com/h
    • http://www.youtube.com/ro
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: goldenfox93
Re: General Chatter Thread
« Reply #30403 on: March 13, 2012, 04:02:25 PM »




"Cries and screams are music to my ears."
-Soundwave

Offline Preytor_4

  • Ultra Heavyweight
  • Posts: 3089
  • Rep: 1
  • The estranged cousin of Click and FB.
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30404 on: March 13, 2012, 04:03:33 PM »
March 10th was Mario day, just tought I should let you know.

Offline GoldenFox93

  • Giga Heavyweight
  • Posts: 12161
  • Rep: -5
  • The Guy
    • http://www.facebook.com/h
    • http://www.youtube.com/ro
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: goldenfox93
Re: General Chatter Thread
« Reply #30405 on: March 13, 2012, 04:07:43 PM »
March 10th was Mario day, just tought I should let you know.
I'm really happy for you and Imma let you finish, but Bacon has the best day of all time- Bacon Day is the 1st September.



"Cries and screams are music to my ears."
-Soundwave

Offline Preytor_4

  • Ultra Heavyweight
  • Posts: 3089
  • Rep: 1
  • The estranged cousin of Click and FB.
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30406 on: March 13, 2012, 04:13:15 PM »
March 10th was Mario day, just tought I should let you know.
I'm really happy for you and Imma let you finish, but Bacon has the best day of all time- Bacon Day is the 1st September.
March 10th was Mario day, just tought I should let you know.
I'm really happy for you and Imma let you finish, but Bacon has the best day of all time- Bacon Day is the 1st September.

True, but Mario day is awesome because of this:

March 10th
March 10
Mar 10
Mar10
Mario

MARIO

Offline That Robot is a Spy!

  • Ultra Heavyweight
  • Posts: 2041
  • Rep: -10
  • ^Best for Business
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
Re: General Chatter Thread
« Reply #30407 on: March 13, 2012, 04:19:24 PM »
March 10th was Mario day, just tought I should let you know.
I'm really happy for you and Imma let you finish, but Bacon has the best day of all time- Bacon Day is the 1st September.
Ironically, this is my dad and one of my best friends birthdays.

Offline Philippa

  • The Queen of GTM
  • Giga Heavyweight
  • Posts: 6186
  • Rep: 0
  • ✊ Viva la Standard! ✊
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30408 on: March 13, 2012, 04:25:09 PM »
March 10th was Mario day, just tought I should let you know.
I'm really happy for you and Imma let you finish, but Bacon has the best day of all time- Bacon Day is the 1st September.
I <3 September 1st!

Offline Mr. AS

  • TheGloriousCarbideArstotzkanIronsideChaosProtocol
  • *
  • Posts: 7557
  • Rep: 19
    • robotarenagtm
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30409 on: March 13, 2012, 04:29:24 PM »
March 10th was Mario day, just tought I should let you know.
i forgot to do the mario!
... :embarr
How you make Alarm Clock Pizza is:
Step 1: You buy an alarm clock from the store, and then you have to break it and put it in the sauce.
Step 2: Fold the sauce in 5 slices and put it in the dough.
Step 3: Paint the eggs with a pitcher of a clock showing what time you want to wake up and eat pizza for breakfast.
Step 4: Put the eggs in the dough.
Step 5: Make it flat into a round shape and draw the time you want on it.
Step 6: Put some old steel to prevent other peple from stealing it.
Step 7: Make it flat and cut into 60 slices 1 for each minute in 1 our.
Step 8: Put in the oven set the timer to 30048813.2884 seconds and put the temperature on 'Volcano' setting.
Step 9: If you think it is take to long, then get yor alarm clock and set it to now so that it will ring and you can take it out.
Step 10: Take it out uv the uvin wen it is redy and go to bed. In the morning eat pizza and also eat yor hands bi mistake.

Offline Enigm@

  • convicted sex offender
  • *
  • Posts: 6616
  • Rep: 5
  • :really_makes_you_think:
    • http://www.youtube.com/us
    • View Profile
    • Awards
  • Skype: uncle_slamm
Re: General Chatter Thread
« Reply #30410 on: March 13, 2012, 04:31:02 PM »
okay i'm having a problem.. every time I try to stream a video on youtube, my computer sh**s itself and lags to all bloody hell..

what do ?
(◕‿◕✿) discord: uncle_slamm steam: bigmommaprodz #unbanlra2

Offline smashysmashy

  • Posts: 2990
  • Rep: 0
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30411 on: March 13, 2012, 04:35:33 PM »
okay i'm having a problem.. every time I try to stream a video on youtube, my computer sh**s itself and lags to all bloody hell..

what do ?
Don't go on Youtube and lurk GTM for a bit?

Offline GoldenFox93

  • Giga Heavyweight
  • Posts: 12161
  • Rep: -5
  • The Guy
    • http://www.facebook.com/h
    • http://www.youtube.com/ro
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: goldenfox93
Re: General Chatter Thread
« Reply #30412 on: March 13, 2012, 04:36:40 PM »
March 10th was Mario day, just tought I should let you know.
i forgot to do the mario!
... :embarr
Here you are-

Do the Mario! Swing your arms, from side to side, come on it's time to go, Do the Mario...



"Cries and screams are music to my ears."
-Soundwave

Offline Enigm@

  • convicted sex offender
  • *
  • Posts: 6616
  • Rep: 5
  • :really_makes_you_think:
    • http://www.youtube.com/us
    • View Profile
    • Awards
  • Skype: uncle_slamm
Re: General Chatter Thread
« Reply #30413 on: March 13, 2012, 04:40:39 PM »
No as in when someone even embeds a video my computer has a heart attack..
(◕‿◕✿) discord: uncle_slamm steam: bigmommaprodz #unbanlra2

Offline Mr. AS

  • TheGloriousCarbideArstotzkanIronsideChaosProtocol
  • *
  • Posts: 7557
  • Rep: 19
    • robotarenagtm
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30414 on: March 13, 2012, 04:45:07 PM »
youtube is pretty much made to rape your RAM chip 6 ways from sunday
How you make Alarm Clock Pizza is:
Step 1: You buy an alarm clock from the store, and then you have to break it and put it in the sauce.
Step 2: Fold the sauce in 5 slices and put it in the dough.
Step 3: Paint the eggs with a pitcher of a clock showing what time you want to wake up and eat pizza for breakfast.
Step 4: Put the eggs in the dough.
Step 5: Make it flat into a round shape and draw the time you want on it.
Step 6: Put some old steel to prevent other peple from stealing it.
Step 7: Make it flat and cut into 60 slices 1 for each minute in 1 our.
Step 8: Put in the oven set the timer to 30048813.2884 seconds and put the temperature on 'Volcano' setting.
Step 9: If you think it is take to long, then get yor alarm clock and set it to now so that it will ring and you can take it out.
Step 10: Take it out uv the uvin wen it is redy and go to bed. In the morning eat pizza and also eat yor hands bi mistake.

Offline Enigm@

  • convicted sex offender
  • *
  • Posts: 6616
  • Rep: 5
  • :really_makes_you_think:
    • http://www.youtube.com/us
    • View Profile
    • Awards
  • Skype: uncle_slamm
Re: General Chatter Thread
« Reply #30415 on: March 13, 2012, 04:53:41 PM »
whoops it only does this with chrome.

brb updating flash.
(◕‿◕✿) discord: uncle_slamm steam: bigmommaprodz #unbanlra2

Offline Badger

  • Permanent Artifact
  • Giga Heavyweight
  • Posts: 6313
  • Rep: 2
  • I wish to be with my people
  • Awards BOTM Winner Donated money for site hosting 2019
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30416 on: March 13, 2012, 06:35:08 PM »
Speaking of browsers, what do you guys use?

Nightly FTW; 64-bit version of Firefox. Just as fast as Chrome for me, amd crashes less.
also lol at most toxic guy around calling others out on this sh**
Google Drive with my newer bots

Offline Philippa

  • The Queen of GTM
  • Giga Heavyweight
  • Posts: 6186
  • Rep: 0
  • ✊ Viva la Standard! ✊
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30417 on: March 14, 2012, 03:15:24 AM »
Morning all.

Pi day today. Guess whose maths teacher is going way over the top with circles today?

Offline Jonzu95

  • Giga Heavyweight
  • Posts: 12638
  • Rep: -28
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30418 on: March 14, 2012, 03:17:08 AM »
Chrome all the way. Mozilla is ok, explorer is poor.

Offline RammingSpeed

  • Super Heavyweight
  • Posts: 815
  • Rep: 1
  • *Insert generic but still funny autism joke*
    • View Profile
    • Awards
Re: General Chatter Thread
« Reply #30419 on: March 14, 2012, 03:24:34 AM »
Used to use explorer, just changed about 3 weeks ago.
:google:
If you notice this notice you will notice that this notice is not worth noticing.