Subscriptions

Elan has only one-dimensional arrays (rows) of a size (<#3882#>cardinality<#3882#>) fixed at compile time. A row can be subscripted to obtain one of its elements (which in its turn may be a row, a structure or a simple value). A multidimensional array can be realized as a row of rows.

(315,040)<#4640#> (000,030)<#4529#>subscription<#4529#> 190 (000,010)<#4530#>(1,0)<#3884#>030<#3884#><#5453#>#tex2html_wrap7221#(060,010)<#5454#>primary<#5454#><#5453#> (1,0)<#3887#>030<#3887#> <#5460#>(010,010)<#5463#>[<#5463#><#5460#> (010,010) (1,0)<#3890#>030<#3890#><#5465#>#tex2html_wrap7231#(060,010)<#5466#>expression<#5466#><#5465#> (1,0)<#3893#>030<#3893#> <#5472#>(010,010)<#5475#>]<#5475#><#5472#> (010,010) (1,0)<#3896#>030<#3896#><#4530#> 191 <#4640#>

The <#3897#>primary<#3897#> must yield a row. The <#3898#>expression<#3898#> must yield an integer, whose value lies between 1 and the <#3899#>cardinality<#3899#> of that row. The type of a <#3900#>subscription<#3900#> is the type of the element yielded. The <#3901#>subscription<#3901#> inherits the access attribute of the <#3902#>primary<#3902#>. This implies that an assignation to a <#3903#>subscription<#3903#> is possible only if the <#3904#>primary<#3904#> is a variable.