Numerical-choice

The <#4121#>numerical-choice<#4121#> is a somewhat baroque construct for choosing between a number of cases on the basis of an integer.

(315,160)<#4649#> (000,150)<#4569#>numerical-choice<#4569#> 229 (000,130)<#4570#>(1,0)<#4123#>030<#4123#> <#5649#>(040,010)<#5652#>SELECT<#5652#><#5649#> (040,010) (1,0)<#4126#>030<#4126#><#5654#>#tex2html_wrap7605#(060,010)<#5655#>expression<#5655#><#5654#> (1,0)<#4129#>030<#4129#> <#5661#>(040,010)<#5664#>OF<#5664#><#5661#> (040,010) (1,0)<#4132#>005<#4132#><#4570#> 230 (235,120)<#4133#>(20,20)[r]<#4133#> (235,110)<#4571#>(-1,0)<#4134#>210<#4134#><#4571#> (025,100)<#4135#>(20,20)[l]<#4135#> 231 (025,090)<#4572#>(1,0)<#4136#>005<#4136#> <#5670#>(040,010)<#5673#>CASE<#5673#><#5670#> (040,010) (1,0)<#4139#>060<#4139#><#5675#>#tex2html_wrap7621#(070,010)<#5676#>number<#5676#><#5675#> (1,0)<#4142#>060<#4142#> <#5682#>(010,010)<#5685#>:<#5685#><#5682#> (010,010) (1,0)<#4145#>005<#4145#><#4572#> 232 (105,080)<#4146#>(20,20)[rt]<#4146#> (125,080)<#4147#>(20,20)[lb]<#4147#> 233 (125,070)<#4573#>(1,0)<#4148#>005<#4148#><#5687#>#tex2html_wrap7631#(070,010)<#5688#>synonym-name<#5688#><#5687#> (1,0)<#4151#>005<#4151#><#4573#> 234 (205,080)<#4152#>(20,20)[rb]<#4152#> (225,080)<#4153#>(20,20)[lt]<#4153#> 235 (235,080)<#4154#>(20,20)[rt]<#4154#> (245,080)<#4574#>(0,-1)<#4155#>020<#4155#><#4574#> (235,060)<#4156#>(20,20)[rb]<#4156#> (235,050)<#4575#>(-1,0)<#4157#>65<#4157#><#4575#> (095,050)<#4576#>(1,0)<#4158#>065<#4158#> <#5694#>(010,010)<#5697#>,<#5697#><#5694#> (010,010) <#4576#> (095,060)<#4161#>(20,20)[lb]<#4161#> (085,060)<#4577#>(0,1)<#4162#>020<#4162#><#4577#> (095,080)<#4163#>(20,20)[lt]<#4163#> 236 (275,080)<#4164#>(20,20)[rt]<#4164#> (285,080)<#4578#>(0,-1)<#4165#>040<#4165#><#4578#> (275,040)<#4166#>(20,20)[rb]<#4166#> (275,030)<#4579#>(-1,0)<#4167#>005<#4167#><#4579#> (025,030)<#4580#>(1,0)<#4168#>185<#4168#><#5699#>#tex2html_wrap7641#(060,010)<#5700#>paragraph<#5700#><#5699#><#4580#> (025,040)<#4171#>(20,20)[lb]<#4171#> (015,040)<#4581#>(0,1)<#4172#>040<#4172#><#4581#> (025,080)<#4173#>(20,20)[lt]<#4173#> 237 (025,020)<#4174#>(20,20)[l]<#4174#> (205,020)<#4175#>(20,20)[l]<#4175#> (025,010)<#4582#>(1,0)<#4176#>005<#4176#> <#5706#>(060,010)<#5709#>OTHERWISE<#5709#><#5706#> (060,010) (1,0)<#4179#>030<#4179#><#5711#>#tex2html_wrap7651#(060,010)<#5712#>paragraph<#5712#><#5711#> (1,0)<#4182#>030<#4182#> <#5718#>(060,010)<#5721#>ENDSELECT<#5721#><#5718#> (060,010) (1,0)<#4185#>030<#4185#><#4582#> 238 <#4649#>

The cases must be labeled either with a <#4186#>number<#4186#> or with a synonym for a <#4187#>number<#4187#>, and therefore have a value fixed at compile-time. The labels of the cases must all be different and need not be ordered.

The <#4188#>numerical-choice<#4188#> is executed by first computing the value of the <#4189#>expression<#4189#>, which must yield an integer, and then executing the <#4190#>paragraph<#4190#> whose case label has that value, if any. If there is no <#4191#>paragraph<#4191#> labeled with this value, the otherwise-part (if any) is executed. The type of the <#4192#>numerical-choice<#4192#> is the type of the <#4193#>paragraph<#4193#> executed. Therefore all <#4194#>paragraphs<#4194#> in the <#4195#>numerical-choice<#4195#> must have the same type.