Operator { } Foundation
Literal array: encloses values for literal arrays.
{ <Expression,...> }
Within program code, the curly braces enclose a literal array. An array is a data type which can store multiple values. The various values of an array are stored in its array elements. All expressions within the curly braces are evaluated at runtime before each is stored in the array as an array element. This can be used to initialize array elements with default values.
Literal arrays are generally used with the inline assignment operator. This assigns the array to a variable immediately after its variable declaration by referencing a literal array containing values in its elements.
// This example demonstrates how variables are initialized
// in their declaration using literal arrays.
PROCEDURE Main
STATIC saFiles := ; // assign literal array
{ "CUSTOMER.DBF", ; // of constant values
"INVOICE.DBF", ; // to STATIC variable
"ARTICLE.DBF" }
LOCAL aLogin := ; // assign literal array
{ Time(), Date() } // with expressions
// to LOCAL variable
LOCAL aArray := ; // assign multidimensional
{ ; // array with changing
{ 1, 2 }, ; // values to LOCAL variable
{"James", "Bond"}, ;
.T., ;
Directory(), ;
Date() ;
}
Aeval( aLogin , {|x| QOut(x) } ) // output log in time
// open files
Aeval( saFiles, {|c| DbUseArea(.T., , c )} )
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.