|
|||||
|
|||||
Prerequisite Concepts | |||||
Shelf Literals |
A shelf literal is the portion of a shelf declaration following the initial
keyword: much like
"Hello, World!"
is a string
literal, 5
is a numeric literal, and true
is
a switch
literal, so
{ "Hello, World!" with key "a", "Salut, Monde!" with key "b" }is a literal value for a shelf. Note that the braces are part of the shelf literal.
A shelf can be initialized with a shelf literal:
define string source function format-numbers (read-only integer j) elsewhere process local integer i initial { 1, 2, 3, 4, 5 } output format-numbers (i)Here, the portion following the
initial
keyword is a shelf literal being used to initialize the integer
shelf i. However, in this case, the local
integer
shelf i is
unnecessary, as the shelf literal itself can be passed directly to the function:
define string source function format-numbers (read-only integer j) elsewhere process output format-numbers ({ 1, 2, 3, 4, 5 })
Prerequisite Concepts
|
Copyright © Stilo International plc, 1988-2010.