Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lining up dollar signs($)

Status
Not open for further replies.

pcmedic411

Programmer
Oct 26, 2003
4
US
Hi,

I am having trouble lining up dollar signs. Here is my code:
Code:
PRINT USING "& & $####,.## $####,.## $####,.##"; NAME$; TAB(18); DEPT$; TAB(34); BONUS; TAB(48); LOONGBONUS; TAB(66); MOEARNINGS
Now I thought that would line up all the signs, but it puts the signs in the end of the previous column.

If I use this code:
Code:
PRINT USING "& & $$####,.## $$####,.## $$####,.##"; NAME$; TAB(18); DEPT$; TAB(34); BONUS; TAB(48); LOONGBONUS; TAB(66); MOEARNINGS
The dollar signs are in the correct column but they do not all line up. Any suggestions?

Thanks,

Chuck
 
how about
PRINT USING "\ \ \ \ $####,.## $####,.## $####,.##"; NAME$, DEPT$, BONUS, LOONGBONUS, MOEARNINGS



David Paulson

 
Disregard the above post. I think that you may be after something like this

PRINT USING "& & _$####,.## _$####,.## _$####,.##"; NAME$; TAB(18); DEPT$; TAB(34); BONUS; TAB(48); LOONGBONUS; TAB(66); MOEARNINGS

This should line up the $ sign and the decimals.

David Paulson

 
Thanks for your help David. When I use the format you suggest I get a type mismatch error. I have even tried using the **$ format and that doesn't give me the output I want.

Chuck
 
try splitting up each deal into individual print statements
and using the LOCAYE x,y function to align your $ signs for each entry so the same location on each row will align in the same column on the previous rows, etc...

Skip the TAB(xx) statements because i think it is taking the TAB position from the last character displayed in your variables.

(.ie. John Dowry is longer than Ben Gay so the result would be like this:

John Dowry Department $2300.00 $2039.00 $20390.00
Ben Gay Department $2300.00 $2039.00 $20390.00

see if the locate x,y function will resolve your missaligment issues)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top