![]() |
||
|
||
![]() |
Some variables do not contain any displayable content themselves, but rather, are containers; they contain other variables. There are two basic types of container: hashes and sequences.
A hash associates a unique lookup name with each variable it contains.
A sequence associates a number with each variable it contains. Note that the counting starts at zero. Thus, the index for the first item is 0, the number for the second item is 1, and so on.
One very basic difference between hashes and sequences is that the latter defines an ordering (or sequence) for the items it contains (i.e. which subvariable is the first, the second, the third, etc.) while the former has no intrinsic ordering.
Note that it is possible for a variable to be both a hash and a sequence, in which case, it would support index-based access as well as access by lookup name. However, typically a container will be either a hash or a sequence, not both.
A variable that is a collection is used like a sequence except that you cannot access its size or retrieve its subvariables by index. From your viewpoint a collection is just a restricted sequence that can only be used with list directive.
![]() |
||
|
||
![]() |
![]() |
|
Page generated: 2004-06-15 22:17:59 GMT | FreeMarker Manual -- For FreeMarker 2.3 |