Dear all,
I have a program that works fine, but it takes too long to save the data. I think the reason for this is using a loop to build a string then saving the file. Below is my code
arWire2 and Utunnel dbl are an array with size 1 X 270000,
i would like to save xpos, ypos, zpos, arwire1, UtunnelDbl more efficiently is currently takes about 30 sec to write one line!!!!!
Thank you
I have a program that works fine, but it takes too long to save the data. I think the reason for this is using a loop to build a string then saving the file. Below is my code
VB.NET:
Xpos, Ypos, Zpos, As integer
strData2 As string
strData3 As string
strData As string
UtunnelDbl As Double
arWire2 As Double
strData2 = ""
Do While Ala < 270000
strData2 = strData2 & UtunnelDbl(Ala) & vbTab & vbTab
Ala = Ala + 1
Loop
Ala = 0
strData3 = ""
Do While Ala < 270000
strData3 = strData3 & arWire2(Ala) & vbTab & vbTab
Ala = Ala + 1
Loop
Ala = 0
strData = Xpos & vbTab & vbTab & Ypos & vbTab & vbTab & Zpos & vbTab & vbTab & strData2 & vbTab & vbTab & strData3
swStreamWriter.WriteLine(strData)
arWire2 and Utunnel dbl are an array with size 1 X 270000,
i would like to save xpos, ypos, zpos, arwire1, UtunnelDbl more efficiently is currently takes about 30 sec to write one line!!!!!
Thank you
Last edited by a moderator: