D
DumberThanSnot
is there a faster way to copy an ArrayList of strings to a string other than
a tight loop.
In it's most simple terms, I'm currently using something like this...
----------------------------
*** NOTE: rtbXML is a Rich Text Box on the form
dim iCntr as integer
dim sText as string
dim arList as new ArrayList
' Code here will be building a very large Rich Text Box string.
arList.Add("String 1")
arList.Add("String 2")
arList.Add("String 3")
' I'd like to replace the following loop with something faster
sText = ""
for iCntr = 0 to arList.Count - 1
sText += arList.Item(iCntr)
next
rtbXML.Rtb = sText
-----------------------------
I'm building the string to hand off to a Rich Test Box such as "rtbXML.rtb =
stext". I'm originally adding the lines of RTB formats to the ArrayList
because adding the formats to the 'stext' variable in small chunks takes a
looooong time. The idea is to have a very fast memcpy to get the arraylist
to sText as quickly as possible. What I would really like is to go directly
from the arraylist to the rtbXML.Rtb, but I'll settle for a fast "memcpy".
Actually, what I would really like is to be able to display my XML text
files in a .NET browser box on my form. I was using the ActiveX browser
control to display the XML files. but, that meant that I had to install the
ActiveX dll for the browser on my customers computers. That wasn't so bad,
but to make a long story short, the environment that my customers have their
computers doesn't make it real easy to install all the extra drivers. So, I
decided to write my own XML viewer which works, but I need to speed up the
RTB section a bit.
thanks for any help,
Brian
a tight loop.
In it's most simple terms, I'm currently using something like this...
----------------------------
*** NOTE: rtbXML is a Rich Text Box on the form
dim iCntr as integer
dim sText as string
dim arList as new ArrayList
' Code here will be building a very large Rich Text Box string.
arList.Add("String 1")
arList.Add("String 2")
arList.Add("String 3")
' I'd like to replace the following loop with something faster
sText = ""
for iCntr = 0 to arList.Count - 1
sText += arList.Item(iCntr)
next
rtbXML.Rtb = sText
-----------------------------
I'm building the string to hand off to a Rich Test Box such as "rtbXML.rtb =
stext". I'm originally adding the lines of RTB formats to the ArrayList
because adding the formats to the 'stext' variable in small chunks takes a
looooong time. The idea is to have a very fast memcpy to get the arraylist
to sText as quickly as possible. What I would really like is to go directly
from the arraylist to the rtbXML.Rtb, but I'll settle for a fast "memcpy".
Actually, what I would really like is to be able to display my XML text
files in a .NET browser box on my form. I was using the ActiveX browser
control to display the XML files. but, that meant that I had to install the
ActiveX dll for the browser on my customers computers. That wasn't so bad,
but to make a long story short, the environment that my customers have their
computers doesn't make it real easy to install all the extra drivers. So, I
decided to write my own XML viewer which works, but I need to speed up the
RTB section a bit.
thanks for any help,
Brian