Results 1 to 4 of 4
  1. #1
    utherson601's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Behind Closed Doors
    Posts
    55
    Reputation
    10
    Thanks
    7
    My Mood
    Yeehaw

    Question Out of bounds error

    ill do a code dump of all of it, but its erroring when i dont think it should be, as the array has enough slots for the request
    the code is pretty straight forward, smilies show where the error is occuring, and i know that i dont need all the date variables im giong to remove them now..
    Code:
      
      Public Arrnumbervalue(5, 11, 30, 23) As String
        Public Iday As Integer = Date.Now.Day
        Public IMonth As Integer = Date.Now.Month
        Public Iyear As Integer = Date.Now.Year
        Public Ihour As Integer = Date.Now.Hour
        Public IntMonth As Integer = IMonth
        Public IntYear As Integer = Iyear
        Public IntDay As Integer = Iday
        Public IntHour As Integer = Ihour
        Dim tmron As Boolean = False
        Public tmrleft As Integer
    Code:
     
       Private Sub cbxHour_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbxHour.CheckedChanged
    
            If tmron = False Then
                ddbDay.SelectedIndex = Iday - 1
                ddbYear.SelectedIndex = Iyear - 2008
                ddbMonth.SelectedIndex = IMonth - 1
                ddbHour.SelectedIndex = Ihour - 1
                tmrhour.Enabled = True
                tmron = True
                timerleft()
                tmrhour.Interval = tmrleft
            Else
                tmrhour.Enabled = False
                tmron = False
    
            End If
        End Sub
    there is 4 of these
    Code:
        Private Sub cbxYear_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddbYear.SelectedIndexChanged
            IntYear = ddbYear.SelectedIndex
            textcheck()
        End Sub
    Code:
     
       Public Function textcheck() As Process
            Dim Int1 As Integer = Form3.IntHour
            Dim Int2 As Integer = Form3.IntDay
            Dim Int3 As Integer = Form3.IntMonth
            Dim Int4 As Integer = Form3.IntYear
            Dim Int11 As Integer = Form3.IntHour
            Dim Int22 As Integer = Form3.IntDay
            Dim Int33 As Integer = Form3.IntMonth
            Dim Int44 As Integer = Form3.IntYear
    
         :(   Form3.txtNow.Text = Form3.Arrnumbervalue(Form3.IntYear, Form3.IntMonth, Form3.IntDay, Form3.IntHour) :(
    
            Try
                Form3.txtLast.Text = Form3.Arrnumbervalue(Form3.IntYear, Form3.IntMonth, Form3.IntDay, (Int1 - 1))
            Catch
                Try
                    Form3.txtLast.Text = Form3.Arrnumbervalue(Form3.IntYear, Form3.IntMonth, (Int2 - 1), 0)
                Catch
                    Try
                        Form3.txtLast.Text = Form3.Arrnumbervalue(Form3.IntYear, (Int3 - 1), 0, 0)
                    Catch
                        Form3.txtLast.Text = Form3.Arrnumbervalue((Int4 - 1), 0, 0, 0)
                    End Try
                End Try
            End Try
            Try
                Form3.txtLater.Text = Form3.Arrnumbervalue(Form3.IntYear, Form3.IntMonth, Form3.IntDay, (Int11 + 1))
            Catch
                Try
                    Form3.txtLater.Text = Form3.Arrnumbervalue(Form3.IntYear, Form3.IntMonth, (Int22 + 1), 0)
                Catch
                    Try
                        Form3.txtLater.Text = Form3.Arrnumbervalue(Form3.IntYear, (Int33 + 1), 0, 0)
                    Catch
                        Form3.txtLater.Text = Form3.Arrnumbervalue((Int44 + 1), 0, 0, 0)
                    End Try
                End Try
            End Try
    
        End Function
    Last edited by utherson601; 03-06-2012 at 01:11 AM.
    "He who joyfully marches to music rank and file, has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice"-Eistein

  2. #2
    sythe179's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    The internet
    Posts
    660
    Reputation
    15
    Thanks
    1,458
    My Mood
    Paranoid
    Public Arrnumbervalue(5, 11, 30, 23) As String
    Public Iyear As Integer = Date.Now.Year
    Dim Int4 As Integer = Form3.IntYear
    Form3.txtNow.Text = Form3.Arrnumbervalue(Form3.IntYear, Form3.IntMonth, Form3.IntDay, Form3.IntHour)

    isent the year higher than 5?...

  3. #3
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Try using structures.



  4. The Following User Says Thank You to Blubb1337 For This Useful Post:

    sythe179 (03-07-2012)

  5. #4
    utherson601's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    Behind Closed Doors
    Posts
    55
    Reputation
    10
    Thanks
    7
    My Mood
    Yeehaw
    Quote Originally Posted by *****179 View Post
    Public Arrnumbervalue(5, 11, 30, 23) As String
    Public Iyear As Integer = Date.Now.Year
    Dim Int4 As Integer = Form3.IntYear
    Form3.txtNow.Text = Form3.Arrnumbervalue(Form3.IntYear, Form3.IntMonth, Form3.IntDay, Form3.IntHour)

    isent the year higher than 5?...
    Code:
       
         Dim Int1 As Integer = Form3.IntHour
            Dim Int2 As Integer = Form3.IntDay
            Dim Int3 As Integer = Form3.IntMonth
            Dim Int4 As Integer = Form3.IntYear        Dim Int11 As Integer = Form3.IntHour
            Dim Int22 As Integer = Form3.IntDay
            Dim Int33 As Integer = Form3.IntMonth
            Dim Int44 As Integer = Form3.IntYear
    
            Form3.txtNow.Text = Form3.Arrnumbervalue((Form3.IntYear - 2008), Form3.IntMonth, Form3.IntDay, Form3.IntHour)
    No as this is what its meant to be but, i forgot to add it, other then that this should work, and blubb..... functions would make this even more complicated then it needs to be.
    "He who joyfully marches to music rank and file, has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice"-Eistein

Similar Threads

  1. [Help Request] OUT OF MEMORY ERROR!
    By xdlolhitsxd in forum Minecraft Help
    Replies: 12
    Last Post: 08-28-2011, 07:05 AM
  2. Ran out of memory Error
    By eeyaz in forum Call of Duty Modern Warfare 2 Help
    Replies: 9
    Last Post: 02-20-2010, 10:08 AM
  3. I believe i have figured out the over buff/c++ error with the bypass
    By beteasta3 in forum Combat Arms Hacks & Cheats
    Replies: 17
    Last Post: 07-15-2009, 03:23 AM
  4. Error with out hacks
    By neodemon in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 5
    Last Post: 05-29-2009, 03:09 PM
  5. Check out this error fellows.
    By vervisvaldo in forum Combat Arms Hacks & Cheats
    Replies: 4
    Last Post: 08-08-2008, 05:02 PM