Assignments to uncast dummy fields (was Re: simple
Kenneth Brody
kenbrody at bestweb.net
Fri Feb 15 12:22:33 PST 2008
Quoting Larry S. Weaver Jr. (Fri, 15 Feb 2008 14:29:53 -0500):
> Just playing around with Ken's little test routine, not only can you
> force filepro to treat a text string ("000019foo") as a number by
> performing a math function on it:
>
> ie xx="000019foo"+"0" gives "19" with field edit (25,f)
Unless date- or time-math is invoked, the result of addition is a number.
> 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,*)
The result of concatenation is a string.
> 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"
>
> (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.
Nothing "mysterious" going on here -- it's called "operator precedence".
The above are equivalent to:
yy { (""+"3") ==> "15" { "3" ==> "153"
yy { (""-"3") ==> "15" { "-3" ==> "15-3"
yy { (""*"3") ==> "15" { "0" ==> "150"
yy { (""/"3") ==> "15" { "0" ==> "150"
--
KenBrody at BestWeb dot net spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com
More information about the Filepro-list
mailing list