Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Between or not between. That is the question.
Message
From
24/07/2000 22:00:13
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00396297
Message ID:
00396446
Views:
9
Charles,

>betw(50, 1, 100) = TRUE
>betw(50, 100, 1) = FALSE
>betw(-1, 0,-100) = FALSE (this is what got me since I was using variables) => Between (adjust_amount,0,due_amount) should be valid but wasn't. The fix is easy, but it got me.

Good one. That's the kind of logic error that is often hard to track down -- when the data falls outside of the range that the programmer had in mind.

So, we need to remember that the second parameter represents the LOW value, and the third the HIGH value.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Reply
Map
View

Click here to load this message in the networking platform