Centering lines on reports...
Fairlight
fairlite at fairlite.com
Mon Jun 21 09:21:51 PDT 2004
Yo, homey, in case you don' be listenin', Kenneth Brody done said:
> Fairlight wrote:
> >
> > The honourable and venerable John Esak spoke thus:
> > > Then: mid(aa,"40"-len(ab)/"2",len(ab))=ab
> >
> > John, shouldn't that be "80"-len(ab)/"2" rather than 40? By your formula,
> > you'd be centering on the 20th column, wouldn't you?
>
> Division has higher precedence than addition. Therefore, John's code is
> equivalent to:
>
> "40" - ( len(ab)/"2" )
Yeah, I just read the other replies and figured out that same difference.
So my usual method of:
(80 - length) / 2
is equivalent to
40 - (length / 2)
Same result, different ordering.
Okay, so I read the order of precedence wrong. I guess I'm just used to
the way I've calculated it for 25 years. :) I probably wouldn't have
missed it with explicit parentheses, but that's my fault, not John's.
Sorry about that, John.
mark->
--
Bring the web-enabling power of OneGate to -your- filePro applications today!
Try the live filePro-based, OneGate-enabled demo at the following URL:
http://www2.onnik.com/~fairlite/flfssindex.html
More information about the Filepro-list
mailing list