Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SET FILTER TO BETWEEN(value,min1,max1) OR BETWEEN(value,min2,max2)
Operator, Operator, Give Me Number Nine
"Reeling and Writhing, of course, to begin with," the Mock Turtle replied, "and the different branches of Arithmetic—Ambition, Distraction, Uglification, and Derision."
Lewis Carroll, Alice's Adventures in Wonderland, 1865
Remember seventh grade (or maybe it was sixth or eighth) when you learned a mnemonic that went something like "Please Excuse My Dear Aunt Sally?" Right about now, you're probably scratching your head and saying, "Oh, sure, those are the Great Lakes, right?," or "Yeah, that sounds familiar, but what's it about?" unless, like us, you remember this kind of stuff forever, and you're sitting there saying "Sure, parentheses, exponents, multiplication, division, addition, subtraction." You got it: The mnemonic provides the order of precedence of numeric operators. That is, when you see:
3 + 7 * 4
you know that it's 31, not 40, because multiplication comes before addition (except in the dictionary). On the other hand:
(3 + 7) * 4
is 40 because parentheses come before any other operators. When there are multiple operators at the same level, they're evaluated from left to right.
In Xbase, there are a bunch of other operators besides arithmetic operators. Comparison operators (=, <>, <, >, <=, >=, and $) are used to compare values (big surprise). Logical operators (AND, OR, NOT) are used to combine logical expressions (often comparisons).
Some of the operators used for arithmetic can also be applied to other data types (all of them for double, integer and currency, + and - for characters, - for dates and datetimes). There's also one additional arithmetic operator (%, which is the same as MOD()) that applies to numeric, float, double, integer and currency values.
The arithmetic precedence rules have been extended to cover the full set of operators. Arithmetic operators used on other types have the same precedence as when they're used with numbers. The % has the same precedence as multiplication and division.
The complete precedence rules for FoxPro are somewhat different from those in some other programming languages. In particular, logical operators come below arithmetic and comparison operators:
Parentheses
Exponentiation
Multiplication/Division/Modulo
Addition/Subtraction
Comparison
NOT
AND
OR
Maybe the FoxPro version of the old mnemonic should be "Please Excuse Miss Daisy Mae And Sally Combing Nits All October?" Maybe not.
Select agreport
Set Order To cref1
Do Case
Case This.Parent.chkValue.Value = 1
SET FILTER TO !(totday < 1.00 AND totday > -0.99)
Otherwise
Set Filter To
Endcase
Go Top
set filter to > 1.00
set filter to > -0.99
I want the value which should be greater than 1.00 and should not less than -0.99.
SET FILTER TO BETWEEN(Amount, -0.99, 1)
? between(nValue, 1.00, -0.99)
? between(nValue, -0.99 , 1.00)
BETWEEN(eTestValue, eLowValue, eHighValue)
!(totday < 1.00 AND totday > -0.99)
!(totday > -0.99 AND totday < 1.00)