Repetition

There is one, at first glance rather huge construct, which serves to express <#4197#>repetitions<#4197#>. Its purpose is to repeat a <#4198#>paragraph<#4198#> under various circumstances.

(315,300)<#4650#> (000,290)<#4583#>repetition<#4583#> 239 (000,270)<#4584#>(1,0)<#4200#>030<#4200#> <#5727#>(040,010)<#5730#>FOR<#5730#><#5727#> (040,010) (1,0)<#4203#>030<#4203#><#5732#>#tex2html_wrap7705#(060,010)<#5733#>variable-name<#5733#><#5732#> (1,0)<#4206#>005<#4206#><#4584#> 240 (005,260)<#4207#>(20,20)[rt]<#4207#> (015,260)<#4585#>(0,-1)<#4208#>160<#4208#><#4585#> 241 (165,260)<#4209#>(20,20)[r]<#4209#> (165,250)<#4586#>(-1,0)<#4210#>140<#4210#><#4586#> (025,240)<#4211#>(20,20)[l]<#4211#> 242 (025,230)<#4587#>(1,0)<#4212#>005<#4212#> <#5739#>(040,010)<#5742#>FROM<#5742#><#5739#> (040,010) (1,0)<#4215#>030<#4215#><#5744#>#tex2html_wrap7715#(060,010)<#5745#>expression<#5745#><#5744#> (1,0)<#4218#>005<#4218#><#4587#> 243 (165,220)<#4219#>(20,20)[r]<#4219#> (165,210)<#4588#>(-1,0)<#4220#>140<#4220#><#4588#> (025,200)<#4221#>(20,20)[l]<#4221#> 244 (025,190)<#4589#>(1,0)<#4222#>005<#4222#> <#5751#>(040,010)<#5754#>UPTO<#5754#><#5751#> (040,010) (1,0)<#4225#>030<#4225#><#5756#>#tex2html_wrap7725#(060,010)<#5757#>expression<#5757#><#5756#> (1,0)<#4228#>005<#4228#><#4589#> 245 (165,180)<#4229#>(20,20)[rt]<#4229#> (175,180)<#4590#>(0,-1)<#4230#>020<#4230#><#4590#> 246 (025,180)<#4231#>(20,20)[lb]<#4231#> 247 (025,170)<#4591#>(1,0)<#4232#>005<#4232#> <#5763#>(040,010)<#5766#>DOWNTO<#5766#><#5763#> (040,010) (1,0)<#4235#>030<#4235#><#5768#>#tex2html_wrap7735#(060,010)<#5769#>expression<#5769#><#5768#> (1,0)<#4238#>005<#4238#><#4591#> 248 (165,160)<#4239#>(20,20)[r]<#4239#> (165,150)<#4592#>(-1,0)<#4240#>140<#4240#><#4592#> (025,140)<#4241#>(20,20)[l]<#4241#> 249 (025,130)<#4593#>(1,0)<#4242#>005<#4242#> <#5775#>(040,010)<#5778#>WHILE<#5778#><#5775#> (040,010) (1,0)<#4245#>030<#4245#><#5780#>#tex2html_wrap7745#(060,010)<#5781#>expression<#5781#><#5780#> (1,0)<#4248#>005<#4248#><#4593#> 250 (165,120)<#4249#>(20,20)[r]<#4249#> (165,110)<#4594#>(-1,0)<#4250#>140<#4250#><#4594#> (025,100)<#4251#>(20,20)[l]<#4251#> 251 (025,090)<#4595#>(1,0)<#4252#>005<#4252#> <#5787#>(040,010)<#5790#>REP<#5790#><#5787#> (040,010) (1,0)<#4255#>030<#4255#><#5792#>#tex2html_wrap7755#(060,010)<#5793#>paragraph<#5793#><#5792#> (1,0)<#4258#>005<#4258#><#4595#> 252 (165,080)<#4259#>(20,20)[r]<#4259#> (165,070)<#4596#>(-1,0)<#4260#>140<#4260#><#4596#> (025,060)<#4261#>(20,20)[l]<#4261#> 253 (015,060)<#4597#>(0,-1)<#4262#>040<#4262#><#4597#> 254 (025,050)<#4598#>(1,0)<#4263#>005<#4263#> <#5799#>(040,010)<#5802#>UNTIL<#5802#><#5799#> (040,010) (1,0)<#4266#>030<#4266#><#5804#>#tex2html_wrap7765#(060,010)<#5805#>expression<#5805#><#5804#> (1,0)<#4269#>005<#4269#><#4598#> 255 (165,040)<#4270#>(20,20)[r]<#4270#> (165,030)<#4599#>(-1,0)<#4271#>140<#4271#><#4599#> (025,020)<#4272#>(20,20)[l]<#4272#> 256 (025,010)<#4600#>(1,0)<#4273#>005<#4273#> <#5811#>(040,010)<#5814#>ENDREP<#5814#><#5811#> (040,010) (1,0)<#4276#>120<#4276#><#4600#> 257 <#4650#>

Since many of its constituents are optional, it can be tuned to different applications.

The <#4277#>expressions<#4277#> after <#4278#>WHILE<#4278#> and <#4279#>UNTIL<#4279#> are conditions, and therefore have to be boolean. The other <#4280#>expressions<#4280#>, as well as the variable after <#4281#>FOR<#4281#> (<#4282#>controlled variable<#4282#>) have to be integer. The <#4283#>repetition<#4283#> does not yield a value as result (it is an action).

The semantics of the <#4284#>repetition<#4284#> is quite conventional. The for-part can be omitted if the controlled variable does not occur in the body of the <#4285#>repetition<#4285#>. The constituents <#4286#>FROM 1<#4286#>, <#4287#>UPTO maxint<#4287#>, <#4288#>DOWNTO minint<#4288#>, <#4289#>WHILE true<#4289#> and <#4290#>UNTIL false<#4290#> can be omitted (i.e. are assumed if the corresponding constituents is omitted).