[futurebasic] Re: [FB] CASE Question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1999 : Group Archive : Group : All Groups

From: Joe Lewis Wilkins <PepeToo@...>
Date: Thu, 11 Nov 1999 19:00:54 -0800
Hi Stewart,
The first stuff you wrote didn't make sense, unless you're using FB^3 and its
added a new Case Statement, which I doubt. See below for the usual structure
of a Case Statement.

Stewart wrote:

> Is there a way that a CASE statement can be used with any arrangement of
> Boolean or logical statements to replace an IF statement such as:
>
> LONG IF x <= 15 AND x >= 100
>   Do something
> END IF

Use:
Select case x%
  Case x% < 1: doNothingProbably 'Handles 0 and minus number
  Case x% < 16: doSomething       'Handles 1 thru 15
  Case x% > 99: doSomething       'Handles 100 and over - not sure you'd want
to do this
  Case Else: doSomethingElseOrNothingAtAll   'Handles 16 thru 99
end select

Hope this helps out,

Joe Wilkins