English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

You can concatenate strings from different arrays with tabs inbetween to line up the data. Then print the string

The key to lining up the data is:
1.) Use a fixed font like Courier New ( not a proportional font)
2.) Since you will be using tabs inbetween strings it is important to have the strings the same size in lenght. Do this by adding blank spaces to the right end of the strings you be concatenating.

Say you have a word 10 characters long pad it with spaces to make it 25 characters in lenght.

Make a function called PadR which takes a string and a number (like 25) and returns a padded string (word + spaces to make 25 characters long)

To put this all together.

Dim strLine, strTemp as string

Start:
strLine = "" ' clear contents of string
x= x + 1
strTemp = wordArray1(x)
strTemp = PadR(strTemp,25) 'pad string to 25 characters Long
strLine = strTemp & vbTab 'place word 1 into string

strTemp = wordArray2(x)
strTemp = PadR(strTemp,25) 'pad string to 25 characters Long
strLine = strTemp & vbTab 'add word 2

strTemp = wordArray3(x)
strTemp = PadR(strTemp,25) 'pad string to 25 characters Long
strLine = strTemp 'add word 3 end of line don't need a tab

print strLine

loop back to start untill arrays are empty

2006-12-28 18:24:07 · answer #1 · answered by MarkG 7 · 0 0

Use a table.

2006-12-28 21:40:23 · answer #2 · answered by micaso1971 5 · 0 0

fedest.com, questions and answers