LB Booster
Programming >> Compatibility with LB4 >> SELECT CASE oddity
http://lbb.conforums.com/index.cgi?board=compatibility&action=display&num=1401922192

SELECT CASE oddity
Post by Richard Russell on Jun 4th, 2014, 10:49pm

The documented syntax for SELECT CASE is:

Code:
SELECT CASE var
  CASE x
    ' code goes here
  CASE y
    ' code goes here
  CASE ELSE
    ' code goes here
END SELECT 

But what happens if you insert some code before the first CASE, like this:

Code:
SELECT CASE var
    ' spurious code here
  CASE x
    ' code goes here
  CASE y
    ' code goes here
  CASE ELSE
    ' code goes here
END SELECT 

It turns out that neither LB 4.04 nor LBB reports an error in this situation but they behave differently! In LB the spurious code is always executed and in LBB it is never executed (irrespective of the value of var).

So if (presumably by mistake) you do this it will probably result in an incompatibility.

Richard.