Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB 6.0 equivalent to stringbuilder Append Format?

Posted on 2006-06-16
3
Medium Priority
?
1,727 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 150 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

916 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