I have an array of ints which I need display in a text box how is this done ?
Printable View
I have an array of ints which I need display in a text box how is this done ?
It depends on how you want it displayed. If you want it streight across then do this.
text1.text=""
for x = 0 to 10
text1.text=text1.text & array(x) & " , "
next x
text1.text=left(text1.text,len(text1.text)-3) ' this get rid of the last " , "
if you want it displayed vertically then use
text1.text=""
for x=1 to 10
text1.text=text1.text & array(x) & vbCRLF
next x
if a multi array then use
text1 text=""
for x=0 to 10
for y=0 to 10
text1.text=text1.text & array(x,y) & " , "
next y
text1.text=left(text1.text,len(text1.text)-3) ' this gets rid of the last " , "
text1.text=text1.text & vbCRLF
next x
Using the Str() function add a space in front of the variable you are printing. The "&" dose not..