Solved

VB 6.0 equivalent to stringbuilder Append Format?

Posted on 2006-06-16
3
1,566 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

830 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