home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / tools / 1984 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  2.1 KB

  1. Path: sparky!uunet!uunet.ca!wacss!vince_m
  2. From: vince_m@wacss.anixter.com (Vince Mammoliti)
  3. Newsgroups: comp.os.ms-windows.programmer.tools
  4. Subject: Re: Visual Basic Win 2.0
  5. Message-ID: <X8e9wB1w165w@wacss.anixter.com>
  6. Date: Mon, 11 Jan 93 16:36:44 EST
  7. References: <1993Jan8.223222.16819@news.ysu.edu>
  8. Organization: Anixter Canada Inc.
  9. Lines: 48
  10.  
  11. af734@yfn.ysu.edu (Andy Klein) writes:
  12.  
  13. >      I'm using Visual BASIC Standard Edition v2.0 and I've run into
  14. > the following dilemma.  I'm trying to create an array of string by
  15. > concatenating two other values together, but would like the two
  16. > columns of data to each be left justified.  However, the font that
  17. > I am using contains letters of different widths.  For instance,
  18. > assume an array of strings called Names$() and an array of integers
  19. > called Num%() contain the following made-up data:
  20. >  
  21. >      Names$(1) = "Samuel"          Num%(1) = 15
  22. >      Names$(2) = "Richard"         Num%(2) = 3
  23. >      Names$(3) = "Al"              Num%(3) = 221
  24. >      Names$(4) = "James"           Num%(4) = 54
  25. >      Names$(5) = "Bob"             Num%(5) = 11
  26. >  
  27. > I would then like to create a second string array called Results$()
  28. > that contained the following:
  29. >  
  30. >      Results$(1) = "Samuel   15"
  31. >      Results$(2) = "Richard  3"
  32. >      Results$(3) = "Al       221"
  33. >      Results$(4) = "James    54"
  34. >      Results$(5) = "Bob      11"
  35. >  
  36. > My problem is that since the characters in MS-Windows aren't all
  37. > the same pixel width, the column of numbers is not vertically lined
  38. > up correctly when I print the results.  Is there a way to get the
  39. > second column of numbers to be lined up?  Thanks,
  40. > Andy Klein
  41.  
  42.  
  43. Try adding a "TAB" when you are creating the Result
  44.  
  45. Results$(1) = Names$(1) + chr$(11) + Str$(Num%(1))
  46.  
  47. or something like above.
  48.  
  49. Vince,
  50.  
  51. *****************************************************************************
  52.        Anixter Canada Inc.           User: Vince Mammoliti  
  53.       Mississauga, Ontario        Voice: (416) 897-5665 Fax: (416) 897-6236
  54.    Service Is Our Technology     Internet: vince_m@wacss.anixter.com
  55. ****************************************************************************
  56.  
  57.  
  58.