How can I speedup my code?
Posted on 2003-02-27
I'm retriving a textfile in binary format to a string buffer. The content of file is simply user list in comma delimited format. I need to add a prefix to each user and dump it in textbox. Here is the Code:
dim varArray as varient
dim intFree as integer
dim strBuffer as string
intFree = FreeFile
intFileBuffSize = FileLen(cmdImport.FileName$)
strBuffer = Space(intFileBuffSize)
Open cmdImport.FileName$ For Binary Access Read As #intFree
Get #intFree, 1, strBuffer
varArray = Split(strBuffer, Chr$(44), , vbTextCompare)
Do While (1)
strBuffer2 = strBuffer2 & cmbSystems & "\" & varArray(i) & ";"
i = i + 1
txtAccounts = strBuffer2
Loading a File is extrimly fast, however, spliting and modifing users takes an extreme amount of time, aspecaily when I have 1000 or more entires.
Please does anyone have any suggestions.