SELECT statement examples

nested select statements

select x of

case 100

	a = b
	break

case 200

	select x2 of

	case 201

		a = b2
		break

	case 202

		a = b2 + c
		break

	case 203

		a = b2 - c

	end_select

	break

case 300

	a = b - c

end_select

It is equivalent to:

if x == 100 then

	// case 100

	a = b

else if x == 200 then

	// case 200

	if x2 == 201 then

		// case 201

		a = b2

	else if x2 == 202 then

		// case 202

		a = b2 + c

	else if x2 == 203 then

		// case 203

		a = b2 - c

	endif

else if x == 300 then

	// case 300

	a = b - c

endif