Computer arithmetic
Jean-Pierre A. Radley
appl at jpr.com
Sun Jun 16 10:07:12 PDT 2013
Scott Walker propounded (on Sun, Jun 16, 2013 at 11:46:40AM -0400):
| JP said:
| > leading chr("39") to force left-justification of certain columns.
|
| Does that also make it treat a PO# like "234443213435345" like text not like
| a number?
That is precisely what I want. I have a column with entries that are
either all digits, or mixed digits and letters. Without that leading
single-quote, the numbers are right-aligned, the others left-aligned.
I also use chr("39") in to left-justify any MDY/ entries: easier on the
eyes if the next column contains text.
| JP said:
| > learned to have filePro write an Excel SUM function to add up the
| > money columns
|
| How do you do that?
To sum column "f",from the top to row N, the spreadsheet formula is
SUM(f1:fN)
Only numbers in the column get added (text is ignored), so it's OK to
start at row 1. In filePro, @RS is the total number of records; since
my first two rows have titles for the columns, the (@RS)th record will
be on row @rs+2. For columns E through K, the processing is:
::rw=@rs+"2":
::rpt(5)="=sum(e1^Ae"{rw{")":
::rpt(6)="=sum(f1^Af"{rw{")":
,...
::rpt(10)="=sum(j1^Aj"{rw{")":
::rpt(11)="=sum(k1^Ak"{rw{")":
(where '^A' is the CTL-A that filePro uses for a colon in the ASCII
version of the processing table).
--
JP
More information about the Filepro-list
mailing list