Quote Originally Posted by Dave
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]
What are you trying to prove?
You've already been told that a string can hold about 2 billion characters.