Hi Claudio,
The only thing I would change in the VB .NET code is
>Dim i
Dim i As Integer
This way the object "i" will not be boxed and unboxed everytime it is accessed. Try it now... the results should be the same.
hth,
Kamal
>Hi, everybody.
>
>Some months ago, I´ve made some testings to look at the performance of VFP 7 and VB 6 on the string concatenation... by that time, with some research, I discovered about the "dynamic memory allocation" problem of VB 6.
>
>Now, I just teste such thing, but with VFP, C# and VB.NET. As I was reading, VS.NET provides the StringBuilder class, in order to speedup this sort of thing. Well, I´ve run this code in C#:
>
>
>StringBuilder SB = new StringBuilder();
>
>int i=1;
>
>while (i != 30000)
>{
>SB.Append("Hi"+i.ToString());
>SB.Append(" blah blahblah blahblah blahblah blahblah blahblah blah ");
>i++;
>}
>
>
>and in VB:
>
>
>Dim SB = New System.Text.StringBuilder()
>
>Dim i
>
>For i = 1 To 30000
>
> SB.Append("Hi" + i.ToString())
> SB.Append(" blah blahblah blahblah blahblah blahblah blahblah blah ")
>Next
>
>
>As I´m not a VBer, and I´m just starting study C#, I don´t know if that´s the correct way of doing things... anyway, for what people are saying, such code must have similar performance... but, that wasn´t what I saw.
>
>Any comments?