Skip to content
Narta Xaymar Dirks edited this page Oct 31, 2026 · 2 revisions

Blitz3DBlitzPlusBlitzBasic

Select

Select expression
Case value1, value2
statements
Default
statements
End Select

Description

Compares one expression with the values of each Case, from the top, and runs the statements of the first case that matches. The statements of other cases are skipped, with no fall through. The optional Default must be last and runs when no case matched. The block ends with End Select or EndSelect. The expression can be a string, in which case the case values are strings too.

Examples

Function Name$(n)
	Select n
		Case 1 : Return "one"
		Case 2, 3 : Return "two or three"
		Default : Return "other"
	End Select
End Function

Print Name$(1)
Print Name$(3)
Print Name$(9)
one
two or three
other

Related Commands

EndSelect, If, Then

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally