[futurebasic] CASE Question

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

From: Stewart <stharris@...>
Date: Thu, 11 Nov 1999 21:52:49 -0500
The following use of a CASE statement doesn’t work.

dim i,j

for i=1 to 4
for j=1 to 4
case ((i = 3) and (j = 3) )
print "Hit!"
next
next

Error: SELECT structure error in CASE
In file Temp Project at line 18 in Main Program, Code=129448
•case• ((i = 1) and (j = 2) )
'~'
********* End of PPC Code Compile *********
************* End of Compile **************
 Warnings: 0
   Errors: 1
**************************
I kept adding parens to the CASE statement to try to get to see a single
yes or no, but it didn’t work.

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
??

I have a situation with two rows of 15 buttons, one button being set in
each row; and three control buttons. The control buttons work nicely
with the CASE statement, but I have had to go to two LONG IF/END IF
statements for the single button in each row. This only offends my sense
of symmetry. It would give me great satisfaction to avoid such a hybrid
approach