Solved

VB 6.0 equivalent to stringbuilder Append Format?

Posted on 2006-06-16
3
1,593 Views
Last Modified: 2012-06-27
In VB 6.0 is there a built in function to perform the functionality that is provided in the .NET version of stringbuilder?

stringbuilder sb

sb.AppendFormat(variable{0}, 5}

which would produce the value "variable5"

Thanks.
0
Comment
Question by:Able22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
lunchbyte earned 50 total points
ID: 16923628
debug.print = variable & "5" ?

Is that what you are looking for?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 16925133
>>In VB 6.0 is there a built in function to perform the functionality that is provided in the .NET version of stringbuilder?<<
No.  You can write your own, but it would not come close to the speed of the StringBuilder.

lunchbyte,
You may want to test that...
0
 
LVL 9

Expert Comment

by:lojk
ID: 16934588
perhaps we are refering to the add method itself...

In which case i had this bite sized chunklet in my library..

Dim t as new cStringBuilder
t.additem( Var1)
t.additem( var2)
msgbox t.getText


public Class cStringBuilder

private iCollection as new collection
Public Sub AddItem (ItemText as string)
icollection.add(Itemtext)
end sub
Public Sub ResetCollection
Icollection=new collection
end sub
public function GetText as string
gettext=MakeStringFromCollection(iCollection)
end function
private function MakeStringFromCollection(MakeStringCollection as collection,optional terminator as string =vbcrlf) as string
dim t as integer
dim tRet as string
for t= 0 to MakeStringCollection.count-1
tret=tret+MakeStringCollection(t) & terminator
next t
MakeStringFromCollection=tRet
end function

end class
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA : retain and exclude values based on a config sheet and multiple parameters 5 69
passing parameter in sql procedure 9 70
vb6 connector to mongodb 2 163
MsgBox 4 76
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question