Is there something similar to StringBuffer for VB 6.0 ?

talyn00

Golden Member
Oct 18, 2003
1,666
0
0
you really don't need to use a stringbuffer in VB, not that i remember one existing in VB. But lemme guess you're a java programmer?
 

torpid

Lifer
Sep 14, 2003
11,631
11
76
Yes, you do need such things in VB.

The article above is pretty much how I did it when it was needed. Works well enough...
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
This site might help you.

http://www.xbeat.net/vbspeed/

Either that or put in-line ASM in VB with CallWindowLong(). The following also works with VB6:

http://msdn.microsoft.com/library/defau...n-us/dnaraskdr/html/askgui12172002.asp

Code something in C then use the extracted ASM bytecode to execute it with CallWindowLong() in VB. You can use the VarPtr function or the ByRef statement to pass the string by pointer/reference so it can be used by C. The type of string VB uses is equivalent to BSTR (unicode) in C. This might sound farfetched, but it's actually not that hard. I know I can make a DLL library to do this. In fact, what you should really do is code all your string stuff in C and interface the total output back to VB if you want speed. If your C is rusty I can help you convert it so it's faster.

Also I'm curious what you're doing. There may be a more efficient way than concatenating strings. An array perhaps? Maybe even a custom data structure?
 

torpid

Lifer
Sep 14, 2003
11,631
11
76
Somehow I doubt he's doing anything where assembly code is the answer. Maybe it's just me...