Article View: comp.os.ms-windows.programmer.tools
Article #909Re: Visual Basic Win 2.0
From: Vince Mammoliti
Date: Mon, 11 Jan 1993 21:36
Date: Mon, 11 Jan 1993 21:36
46 lines
2220 bytes
2220 bytes
af734@yfn.ysu.edu (Andy Klein) writes:
>
> I'm using Visual BASIC Standard Edition v2.0 and I've run into
> the following dilemma. I'm trying to create an array of string by
> concatenating two other values together, but would like the two
> columns of data to each be left justified. However, the font that
> I am using contains letters of different widths. For instance,
> assume an array of strings called Names$() and an array of integers
> called Num%() contain the following made-up data:
>
> Names$(1) = "Samuel" Num%(1) = 15
> Names$(2) = "Richard" Num%(2) = 3
> Names$(3) = "Al" Num%(3) = 221
> Names$(4) = "James" Num%(4) = 54
> Names$(5) = "Bob" Num%(5) = 11
>
> I would then like to create a second string array called Results$()
> that contained the following:
>
> Results$(1) = "Samuel 15"
> Results$(2) = "Richard 3"
> Results$(3) = "Al 221"
> Results$(4) = "James 54"
> Results$(5) = "Bob 11"
>
> My problem is that since the characters in MS-Windows aren't all
> the same pixel width, the column of numbers is not vertically lined
> up correctly when I print the results. Is there a way to get the
> second column of numbers to be lined up? Thanks,
> Andy Klein
Try adding a "TAB" when you are creating the Result
Results$(1) = Names$(1) + chr$(11) + Str$(Num%(1))
or something like above.
Vince,
*****************************************************************************
Anixter Canada Inc. User: Vince Mammoliti
Mississauga, Ontario Voice: (416) 897-5665 Fax: (416) 897-6236
Service Is Our Technology Internet: vince_m@wacss.anixter.com
****************************************************************************
Technical Details
Message-ID:
<X8e9wB1w165w@wacss.anixter.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!wacss!vince_mReferences:
<1993Jan8.223222.16819@news.ysu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!wacss!vince_m From: vince_m@wacss.anixter.com (Vince Mammoliti) Newsgroups: comp.os.ms-windows.programmer.tools Subject: Re: Visual Basic Win 2.0 Message-ID: <X8e9wB1w165w@wacss.anixter.com> Date: Mon, 11 Jan 93 16:36:44 EST References: <1993Jan8.223222.16819@news.ysu.edu> Organization: Anixter Canada Inc. Lines: 48