In my VB application,I am copying huge amount of data using VB string? This results in performance issue. What shoul I use in place of VB string to improve performance?
A:
One way to solve this is to pre-allocate a byte/char array that is big enough to hold all your concatenated strings.
If you are using VB.NET, then there is the StringBuilder
class.
Mitch Wheat
2009-06-18 11:25:18
Size is not predefined
2009-06-18 11:26:09
+2
A:
Try to make sure you are always passing ByRef wherever possible (in VB6). In VB.Net this is not an issue. Also, maybe preallocate your strings. Analysis and a better description of your programming task can help provide a better answer.
1800 INFORMATION
2009-06-18 11:32:30
+2
A:
This two part article is good source of information for VB6. Some tips mentioned there are:
- Use $ version of string functions (i.e. Replace$ instead of Replace).
- Use LenB() to check if string is empty (or not).
- Use vbNullString constant instead of "".
Grzegorz Gierlik
2009-06-18 11:47:44
A:
Did you try using a StringBuilder from .NET? It is marked as "COM Visible", which means you should be able to use it from VB 6.
Jonathan Allen
2009-06-29 07:57:45