Results 1 to 3 of 3

Thread: Overflow

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2002
    Posts
    52

    Overflow

    Ok well ive seen some programs before where say u load a list into a lsit box and it exceeds a limit it says runtime error or something like that so it doesnt freeze and stuff?Well how would u go about to put something inplace for there to be a limit of 45,000?Thx for the help and any will be appreciated

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Um.

    Something like this I'd say

    VB Code:
    1. '' in some sub/function somwhere
    2. On Error Goto errHandle
    3.     Do Until Eof(1)
    4.         Line Input #1, someStrBuff
    5.         List1.AddItem someStrBuff
    6.     Loop
    7.     Exit Sub '' or Exit Function
    8.  
    9. errHandle:
    10.     If Err.Number = whateverTheCorrectErrorNumberIs Then
    11.         MsgBox "Runtime Error" & Err.Description, vbCritical
    12.         Exit Function
    13.     End If

  3. #3
    Lively Member technitaes's Avatar
    Join Date
    Oct 2002
    Location
    Tennessee, USA
    Posts
    112
    Not certain if this is exactly what you want to do, but...
    VB Code:
    1. 'Assuming some data input loop
    2.  
    3. Do While blnCondition
    4.  
    5.     'Do something
    6.  
    7.     intCount = intCount + 1
    8.     If intCount = 45000 Then Err.Raise 6
    9.  
    10. Loop
    This will raise the Overflow error on the occurrance of the 45,000th input entry.
    tecnithV -- artisan, artificer, workman, mechanic, architect, or builder
    VB6, ASP, HTML, XML, Oracle, Access, MySql, PHP, C++, Etc...
    To format your VB code in this forum use tags like this [vbcode]your code here[/vbcode]

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