Re: dump array in text box
Try:
'(set your text1 multiline property to true)
dim Myarray (127,8) as integer
for x = 1 to 8
text1.text = text1.text & "col" & x & space(1)
next x
i = 0
For x = LBound(MyArray) To UBound(MyArray)
For y = LBound(MyArray, 2) To UBound(MyArray, 2)
MyArray(x, y) = arrHeads(i) ' call to funtion that holds other data
if x < 10 then
text1.text = text1.text & MyArray(x, y) & space(3)
elseif x < 100 then
text1.text = text1.text & MyArray(x, y) & space(2)
else
text1.text = text1.text & MyArray(x, y) & space(1)
end if
i = i + 1
Next y
text1.text = text1.text & vbcrlf
Next x
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
Re: dump array in text box
Here's a demonstration of aligning values in a textbox. You should be able to add the column and row headings for yourself. The only restriction is that the textbox font must be monospaced(such as Courier) and not proportional
private Sub Command1_Click()
Dim myArray(20, 10) as Integer
Dim i as Integer, j as Integer
Dim OneLine as string * 150
for j = 0 to 10
for i = 0 to 20
myArray(i, j) = Rnd() * 1000
next
next
for j = 0 to 10
OneLine = Space(150)
for i = 0 to 20
mid$(OneLine, i * 5 + 1) = myArray(i, j)
next
Text1.Text = Text1.Text & OneLine & vbCrLf
next
End Sub