Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Tom Hoelter
  Where is Tom Hoelter?
 Perrysburg
 Ohio - United States
 Tom Hoelter
 Tags
Subject: RE: Output to a file
Thread ID: 208606 Message ID: 209293 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Friday, December 26, 2008 11:43:25 PM         
   


> >
> >
> > No, the solution is like what Borislav says. Change the font into Courier New and it will align. Just give it a try! ;-)
> >
> > Jun Tangunan
> > http://weblogs.foxite.com/sandstorm36/
>
> No, that's not it. It was in Courier New already. The only rows that don't line up are the 2 percentage rows (MALE 63.1 84.8 30.8 60.3 91.9 & FEMALE 36.9 15.1 69.2 39.7 8.1). I'm not sure if you are seeing the same formatting (above) that I sent you. When you replied to my message the formatting I sent you was not the same. When I click "reply to your message" the formatting (above) is correct. There should be columns that line up.
> I think the problem might have something to do with the line that prints the percentage row: @ row,zz say per(p,n) picture "###.#". The line that prints the other rows is @ row,yy say LTRIM(STR(tots(p,n))) and they are fine.
> Unless you have a different idea, I will put together a simple program to test this and get back to you.
> Thanks!!!

You are right, I did not pay much attention to your sample as I am thinking that should you have used Courier New font, it will all be fixed. When we do a text sample here and wants to preserve original alignment, we can do that by enclosing those with either < PRE > and < /PRE > or < VFP > and < /VFP > without the spaces inbetween brackets and text. Here I will show you (you cannot see those formatting unless you click reply to this message):

Samples on how to preserve alignments here in foxite:

Using PRE


Heading1 Heading2 Heading3
ABCD 12345 .T.
EFGH 32311 .F.
SHORT 13213 .T.


Using VFP

Heading1    Heading2     Heading3
ABCD        12345           .T.
EFGH        32311           .F.
SHORT       13213           .T.


Now, when I rechecked alignment of your sample below Tushar, I observe that the problem seems to appear because of the words MALE and FEMALE which have different lengths. You must have consistent length for that description and that can be done by using PADR() function like this:

@ 0,0 say PADR("MALE",20)+": "+transform(number1,"9,999,999.99")
@ 1,0 say PADR("FEMALE",20)+": "+transform(number2,"9,999,999.99")


That will ensure that the above will first have a fixed length of 20 characters (it will be padded with spaces) before the colon will appear.

I hope this can help solve your problem.

Jun Tangunan
http://weblogs.foxite.com/sandstorm36/

ENTIRE THREAD

Output to a file Posted by Tom Hoelter @ 12/19/2008 7:44:19 PM
RE: Output to a file Posted by Borislav Borissov @ 12/19/2008 8:17:44 PM
RE: Output to a file Posted by Yuri Rubinov @ 12/19/2008 8:18:38 PM
RE: Output to a file Posted by Tom Hoelter @ 12/20/2008 1:07:44 AM
RE: Output to a file Posted by Yuri Rubinov @ 12/22/2008 3:51:46 PM
RE: Output to a file Posted by tushar @ 12/19/2008 8:30:25 PM
RE: Output to a file Posted by Tom Hoelter @ 12/20/2008 1:00:43 AM
RE: Output to a file Posted by Jun Tangunan @ 12/20/2008 1:41:18 AM
RE: Output to a file Posted by Tom Hoelter @ 12/25/2008 5:21:02 AM
RE: Output to a file Posted by Jun Tangunan @ 12/26/2008 11:43:25 PM