[Gambas-user] Questions about SELECT statement

Benoit Minisini gambas at ...1...
Thu Apr 21 10:48:27 CEST 2005


On Thursday 21 April 2005 02:02, nando wrote:
> Does the SELECT test the value only once at the beginning?
>
> a=""
> SELECT x
>
>   CASE 1
>           a = a & "HELLO 1"
>
>   CASE 2
>           a = a & "HELLO 2"
>
>   CASE 3
>           a = a & "HELLO 3"
>           INC x
>
>   CASE 2,4
>           a = a & "HELLO 4"
>
> END SELECT
>
> Questions:
> (1) if x was 3 then the CASE 3 will execute but x will INC
>     so then will it go into CASE 2,4 ?
>
> (2) if x was 2 will both cases for 2 be executed?
>
> (3) if BREAK used to exit the SELECT statement?
>
> Thanks
> -Fernando
>
>

Only one case statement is executed, the first that is true.

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list