Assignments to uncast dummy fields (was Re: simple
Bruce Easton
bruce at stn.com
Fri Feb 15 12:30:05 PST 2008
Bruce Easton wrote Friday, February 15, 2008 3:11 PM:
(response inline again)
> (response inline)
> Larry S. Weaver Jr. wrote Friday, February 15, 2008 2:30 PM:
>
> [..]
> > You can also force it to treat a number as a text string by
> doing a text
> > function on it.
> >
> > yy(2,.0)="15"
> >
> > xx=yy{"" gives "15" with a field edit of (2,*)
> >
> > I then tried to trip it up by doing both with unexpected results:
> >
> > yy(2,.0)="15"
> > xx=yy{""+"3" gave "153" with a field edit of (3,*)
> > xx=yy{""-"3" gave "15-3" with a field edit of (4,*)
> > xx=yy{""*"3" gave "150" with a field edit of (3,*), as did xx=yy{""/"3"
>
> It seems in each of the cases above, yy and the last part of
> the assignment are all treated numerically, prior to
> appending of strings, that is
>
> yy = 15
> ""+"3" = 3
> ""-"3" = -3
> ""*"3" and ""/"3" = 0,
>
> so I'm guessing that filepro assumes the operand ""
> before the numeric operator is zero.
> If that's true, then I would think it would not
> matter if the final result field were text or numeric -
> since the only (outer-most) operation left to do is "{",
> and therefore concatenation is expected.
>
Except that it does matter :):). With xx set as numeric,
the results are the same using +,*,/,
but the result is just "15" when the operator is "-"
(compared to "15-3" when the result field is text).
Bruce
> >
> > (all with filepro 5.0.09)
> >
> > Not that any of those have any real use, but it just goes to show there
> > are some mysterious things going on under the hood.
> >
> > Larry, Jr.
>
> Bruce
>
> Bruce Easton
> STN, Inc.
More information about the Filepro-list
mailing list