Solved

VB 6.0 equivalent to stringbuilder Append Format?

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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
Course of the Month9 days, 15 hours left to enroll

624 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