Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax for IF STATEMENTS
Message
 
 
To
04/02/2003 21:00:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00749162
Message ID:
00749338
Views:
20
>The correct version is as follows:
>
>
>if age >= 55 and age < 65
>
>
>An expression like age >= 55 and age < = 65 can be simplified as between(age, 55, 65), but no equivalent simplification exists if one side uses greater-or-equal, and the other side only less-than, for instance.
>
>HTH, Hilmar.

Well, in this particular case
between(age,55,64)
would work...

In other cases, you have to know the precision of the value, you're checking.

Say, if age field would be N (5,2) it would be safe to write:

between(age,55,64.99)

If you don't know the precision, you must use < and >= notation or pick up lots of decimals... (like 64.99999999999999999) - it may not work yet...
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform