CASE statement error
-
- Posts: 5
- Joined: Tue Oct 10, 2017 12:44 pm
CASE statement error
The following is recent discovery with R&R 10+ using CASE statement.____Fields FROM and TO are from a single record DBF file linked with record 1 in xBase version.____ISBLANK( FROM ) <- returns TRUE__ISBLANK( TO ) <- returns TRUE____CASE( TRUE, ISBLANK( FROM ),1, ISBLANK( TO ), 2, 3 ) <- returns 2__CASE( TRUE, ISBLANK( TO ),1, ISBLANK( FROM ), 2, 3 ) <- Also returns 2____Ke?____hartrung@3logix.com.au____If you hav any fixes or advice please let me know.
=> RE: CASE statement error
Typically a case statement contains a list of mutually exclusive values. In your expression there is more that one member that returns the same value. So R&R is returning the last value in the list that meets the condition rather than the first value in the list.__For example the expression:__CASE(1,1,1,1,2,3)__returns a 2____and __CASE(1,1,1,1,2,1,3,4)__returns a 3____I checked the doc for the function and it does not specifically document how duplicates are handled.____Kathleen__R&R Support__