<@ARRAY>Syntax<@ARRAY [ROWS=rows] [COLS=cols] [VALUE=textValue][CDELIM=columnDelimString] [RDELIM=rowDelimString]> DescriptionReturns an array with a specified number of rows and columns. This meta tag is usually used in conjunction with <@ASSIGN>. See the examples in this section. The attributes ROWS and COLS optionally specify the number of rows and columns in the array, respectively. The optional attribute VALUE specifies a string used for initializing the array, formatted as array elements separated by CDELIM and RDELIM text. ROWS and COLS must be specified if VALUE is not specified. VALUE must be specified if ROWS and COLS are not specified. If all three of these attributes are specified, they must be in accord, or an error is generated. The following example would generate an error because the VALUE specifies three columns and two rows, which contradicts the ROWS and COLS attributes. <@ARRAY ROWS=10 COLS=2 VALUE="a,b,c;d,e,f"> It is also invalid to specify a VALUE attribute with different numbers of columns in each row. The number of columns in each row must be the same, and must match the COLS value, if specified. If the CDELIM and RDELIM attributes were specified as"," and ";", respectively, and the value string were specified as VALUE="1,2,3;4,5,6;7,8,9;a,b,c;" an array with the following structure would be created: For more information, see "cDelim" and "rDelim" . If no values for the column or row delimiters are specified, then the values specified by the configuration variables cDelim and rDelim are used as defaults. ExamplesCreating an array and assigning it to a variable: <@ASSIGN NAME="array1" VALUE="<@ARRAY ROWS='5' COLS='3'>"> Creating and initializing an array, assigning it to a variable, and printing it: <@ASSIGN NAME="initValue" VALUE="1,2,3;4,5,6;7,8,9;a,b,c;d,e,f;g,h,i"> <@ASSIGN NAME="array2" VALUE="<@ARRAY ROWS='5' COLS='3' VALUE=@@initValue CDELIM=',' RDELIM=';'>"> See Also |
Copyright © 1998, Pervasive Software Inc. All rights reserved.