The case statement does not expect a ":" after it.
If you look at the many examples of general use of the case statement, you'll see the you can use...
Select a
Case "abc"
Code here
Case 123
Code here
Case else
End select
The purpose of "case" is to be able to go through more interactions than an "if".
If all you need is to check a variable for a specific value, then use an "IF"...
Which is what I'm using it for. I never said I was just checking a variable for a specific value. The code I posted was merely example/dummy code to show the bug at work.
Actual code:
B4X:
Sub GetListStyleFont(Style As Int) As Typeface
If Style=-1 Then Style = CurrentStyle
Select Case Style
Case STYLE_StarWars: Return Typeface.DEFAULT
Case STYLE_Alien: Return Aliens.LCDfont
Case STYLE_RESIDENTEVIL: Return Typeface.DEFAULT
End Select
Return GetStyleFont(Style)
End Sub
Sub GetStyleFont(Style As Int) As Typeface
If Style=-1 Then Style = CurrentStyle
Select Case Style
Case STYLE_Moon: Return StarshipFont'1
Case STYLE_RoboCop, STYLE_Alien: Return RoboCop.RoboFont'2
Case STYLE_EventHorizon: Return Typeface.DEFAULT_BOLD'3
Case STYLE_BSG: Return Legacy.DRD_Font'4
Case STYLE_StarWars: Return Legacy.SWFont'5
Case STYLE_Prometheus: Return Prometheus.TheFont
Case STYLE_Elysium: Return Elysium.NewFont
Case STYLE_STARGATE: Return StarshipFont
Case STYLE_STroopers: Return StarshipTroopers.Font
Case STYLE_RESIDENTEVIL: Return Prometheus.TheFont
Case STYLE_Watchmen: Return ChicagoFont
Case STYLE_Terminator: Return Terminator.BigFont
Case STYLE_Oblivion: Return Aliens.ArielBold
End Select
Return Typeface.DEFAULT
End Sub
Well, your dummy code was really... dummy, and it didn't reflect exactly what your bug was about.
Now, withe the rest of the "real code" I can understand what your bug report is about and furthermore state that I learned something from your example
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.