- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apparently I can't use a REAL variable as the case expression in a CASE consruct. Is there any similar construct in which I can do effectively the same thing using a REAL, or am I relegated to a series of IF ... THENs?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nope - can't use REALs. Keep in mind that comparing REALs for equality is often a source of trouble, as sometimes a computed result isn't exactly the decimal value you think it is. Depending on what your values are, perhaps you could convert the value to integer and CASE on that?
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, anyway. Yes, I am familiar with the hazards of comparing reals.
Now I just have to decide which is uglier, the IF..THENs, or the conversion to an INTEGER case expression.
Now I just have to decide which is uglier, the IF..THENs, or the conversion to an INTEGER case expression.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page