[Gambas-user] Issue 141 in gambas: Default/Case Else can be executed even if it matched a Case in a Select Statement.
gambas at ...2524...
gambas at ...2524...
Tue Nov 8 18:07:19 CET 2011
Status: New
Owner: ----
Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any
Desktop-Any GUI-Any
New issue 141 by emil.len... at ...626...: Default/Case Else can be executed
even if it matched a Case in a Select Statement.
http://code.google.com/p/gambas/issues/detail?id=141
1) Describe the problem.
The documentation for Select Statement says "If no CASE statement matches,
the DEFAULT or CASE ELSE statement is executed."
It says nowhere that the Default/Case Else must be the last case in the
list, and for the moment the compiler accepts it to be anywhere.
But if you have a testcase after the Case Else/Default it will be matched
to, the Case Else/Default case will also be executed.
2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate):
Version: TRUNK or BRANCHES/2.0 or 2.22.0
Revision: r4236
3) Provide a little project that reproduces the bug or the crash.
Select Case 0
Default
Print "default"
Case 0
Print "0"
Case 1
Print "1"
Case 2
Print "2"
End Select
will print:
default
0
when only "0" is the expected output.
More information about the User
mailing list