Results 1 to 7 of 7

Thread: Runtime Error '6' "Overflow" Resolved

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Resolved Runtime Error '6' "Overflow" Resolved

    Can any1 explain this error without seeing the coding ?

    The code isn't mine is an example. I think its a winsock error. Can any1 help?
    Last edited by Ricky1; Sep 4th, 2005 at 03:34 PM.
    Im Learning !!!!

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Runtime Error '6' "Overflow"

    An overflow error is usually because you try to (for example) assign a number to an integer but the number is to large to fit in the 16-bit signer integer type VB is using. Other then that, it's very hard without seeing any code to determent what the problem is.

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Runtime Error '6' "Overflow"

    If you try to use a number that's bigger than 32678 in an INTEGER, it will produce an OVERFLOW condition because of the size limit for INTEGER.

    It would help to see the code, with the error line in order to tell you exactly why it happened.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Re: Runtime Error '6' "Overflow"

    VB Code:
    1. Private Sub tmrCheckIfClosed_Timer()
    2.    
    3.     '// Assign the list status to the list count
    4.     lblCountUsernames.Caption = lstUsernames.ListIndex + 1 & "/" & lstUsernames.ListCount
    5.     lblCountPasswords.Caption = lstPasswords.ListIndex + 1 & "/" & lstPasswords.ListCount
    6.     lblCountProxys.Caption = lstProxys.ListIndex + 1 & "/" & lstProxys.ListCount
    7.     lblCountServers.Caption = lstServers.ListIndex + 1 & "/" & lstServers.ListCount
    8.    
    9.     Dim intIndex As Integer
    10.    
    11.     For intIndex = 1 To Val(cboSockets.Text)
    12.        
    13.         '// Check for closed sockets (0, sckClosed)
    14.         If wskSendLogin(intIndex).State = 0 Then
    15.            
    16.             '// Disable the timeout timer
    17.             tmrTimeout(intIndex).Enabled = False
    18.            
    19.             Dim strHost As String, intPort As Integer
    20.            
    21.             '// Split the host and port from the proxy
    22.             strHost = Split(strProxy(intIndex), ":")(0)
    23. [COLOR=Red]            intPort = Split(strProxy(intIndex), ":")(1)[/COLOR]
    24.            
    25.             '// Close the socket
    26.             wskSendLogin(intIndex).Close
    27.            
    28.             '// Assign the host and port to the socket
    29.             wskSendLogin(intIndex).RemoteHost = strHost
    30.             wskSendLogin(intIndex).RemotePort = intPort
    31.            
    32.             '// Request Connection
    33.             wskSendLogin(intIndex).Connect
    34.            
    35.             '// Enabled the timeout timer
    36.             tmrTimeout(intIndex).Enabled = True
    37.            
    38.         End If
    39.        
    40.     Next intIndex
    41.    
    42. End Sub

    it errored on this proxy 12.162.2.193:65208

    assuming what you said because 65208 if more then 32678.

    How i correct this ?
    I tried Dim intIndex As Long instead of Integer, still errored.
    Im Learning !!!!

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Runtime Error '6' "Overflow"

    intPort has to be a long. This worked fine.

    VB Code:
    1. Private Sub Form_Load()
    2.   Dim strProxy As Long
    3.   Dim str$
    4.   Dim x$, y As Long
    5.   str = "12.162.2.193:65208"
    6.   x = Split(str, ":")(0)
    7.   y = Split(str, ":")(1)
    8.   MsgBox x & "   " & y
    9. End Sub

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Runtime Error '6' "Overflow"

    Change the type of intPort to be a Long instead of an Integer.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Re: Runtime Error '6' "Overflow"

    ooooo

    didn't see that bit.

    Thanks.
    Im Learning !!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width