Results 1 to 20 of 23

Thread: Solved: Document File Size

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #18
    VBAX Expert Dave's Avatar
    Joined
    Mar 2005
    Posts
    864
    Location
    Thought I'd do a little string error testing. A string can be overloaded. In my following example, the cnt is 32767 loops (it takes a while). Interestingly the message box doesn't contain this many (-1) repititions of the test phrase represented by "b"? Is this loop number determined by my system resources or by a standard available amount of storage space for a string variable? Can someone give this a quick trial and post the loop cnt? Also, any explanations why the message box doesn't contain the string present before the error occurred which is what "b" was supposed to do? Dave
    [vba]Private Sub CommandButton1_Click()
    Dim a As String, b As String, c As String, cnt As Integer
    On Error GoTo Errcntrl
    c = "I'm gonna break"
    Do
    a = a + c
    b = a
    cnt = cnt + 1
    Loop
    Exit sub
    Errcntrl:
    Select Case Err.Number
    Case 6
    MsgBox "Overflow " & cnt & b
    Case Else
    MsgBox Err.Description
    End Select
    End Sub[/vba]
    Last edited by Dave; 04-29-2005 at 10:33 AM. Reason: messed up the tags

Posting Permissions

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