Solved

VB 6.0 equivalent to stringbuilder Append Format?

Posted on 2006-06-16
3
1,491 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
Comment Utility
debug.print = variable & "5" ?

Is that what you are looking for?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
>>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
Comment Utility
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 run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now