Home » questions » Visual Basic 6.0: Show contents of 2x120 array in multiline text box how?

Visual Basic 6.0: Show contents of 2x120 array in multiline text box how?

2006-08-08 22:18:13, Category: Programming & Design
I'm trying to display the contents of a 2 column by 120 row array into one multiline text box, but I'm not sure how. I've found many articles describing how to take data from a multiline text box and put it into an array, but not the opposite. I'm trying to save myselft the trouble of writing code for 240 individual text boxes. Thanks for your help.

Answers

  1. Andy D

    On 2006-08-09 00:22:52


    Ok Im a little rusty on vb6 but this should do it dim sLine as string dim iFirstRange as integer dim iSecondRange as integer textbox1.text = "" for iFirstRange = 1 to 120 for iSecondRange = 1 to 2 sLine = myArray(iFirstRange, iSecondRange) + vbCrLf next textbox1.text = textbox1.text + sLine next is that what you are after? [quick edit] Just though multiline text boxes may use an array to access each line .. If that is the case use textbox1.text(iFirstRange) = sLine instead of the other text assignment line