Write TXT formatted via VB6

Asked

Viewed 560 times

0

I am trying to copy the structure of a GRID/ Table inside a text file, including copying the structure of the cells(Table).

However, I cannot align the columns in the text file, although it has a default size for each column.

The process works as follows, I measure the largest item contained in each row of each Columa and then use its size to define the total space of the column in question. When the text is smaller than the full column size, I fill in the remaining characters with white space.

What I noticed, that is the letters come out of varied sizes and my measure is given by the number of characters. However, the space that the letter "A" occupies is different from the space occupied by the letter "T" for example.

I tried to choose some true-type font in the notepad(Tahoma,Arial,Impact) but even so the letters seem to have different size in the notepad.

Can you tell me how I could build a standardized size table written on the notepad? Considering for example that the unit of measure is the character size.

1 answer

2


The problem is not in your program that generates the text file (VB6) but in the file view, because if the program used (e.g., notepad) is using a variable spacing source (e.g., Arial) the content will be scrambled.

You do not have to use true-type fonts but fixed spacing fonts, for example: courier new.

  • When using new courier, all alignment was perfect.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.