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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dBase iii+ Screen/Print Positioning

joewillerols

Programmer
Dec 29, 2020
22
US
This is the code.

@ 4,2 SAY "Date Of Birth (MM/DD/YY):"
@ 4,28 SAY DOB
@ 4,42 SAY "Age:"
AGE = INT((DATE() - DOB) / 365.25)
@ 4,47 SAY AGE


This is the display.

Date Of Birth (MM/DD/YY): 02/26/69 Age: 56


Why is the age so far to the right instead of one space to the right like Age: 56?

I tried LTRIM but got an error. It seems that LTRIM only works on character strings and not numeric strings.

If I move AGE further to the left Age: starts to get overwritten.

I removed INT and instead of 56 I got 56.24. I understand why that happened but was hoping that the result would show any preceding zeros.
It's not a big deal since the math is correct and I do get the correct age based on the DOB unless the DOB is February 29. Then it calculates as if February 29 comes every year. Again, not a big deal.


I could do this.
@ 4,39 SAY AGE
@ 4,47 SAY "Age:"

Visually this would work. However, comma, this won't work for printing. By the time AGE is printed, the position will be past where Age: should print and I'd end up with Age: one line below where it should be.

HELP!

Thanks,
Joe
 

Part and Inventory Search

Sponsor

Back
Top