The following simplistic procedure converts a double precision matrix to the string.
Code: Select all
sub clip_string_uni_matrix (Z() As Double)
' converts matrix to clips string variable, which is global
' terminate with CRLF, also the last line
Dim As Integer lbx, ubx, lby, uby, i, j, nx, ny, nxy, nzsize
lbx = Lbound(Z,1)
ubx = Ubound(Z,1)
lby = Lbound(Z,2)
uby = Ubound(Z,2)
clips = ""
For i = lby To uby
For j = lbx to ubx-1
clips = clips + Str(Z(i,j)) + Chr(9)
clips = clips + Str(Z(i,ubx)) + Chr(13) + Chr(10)
Matrix has 511 x 511 size. With clips dim shared as string, conversion takes 13.5 seconds.
If clips is dim shared as Zstring *5505024, it takes 4 times longer. Anyway, it is extremely
slow. How to make it faster?
(win10, 1.05, 64)