Google Search diml.org
[ french ]

Table des matières
 Latest News
 An application of the  WCT_NEWS  component
>> Top of page

Data Injection Markup Language Reference

Matrix Call


Module : Core Group : Variables Call
<%%implicit-table-name[]...[]%%>

A data multidimensional array is implicitely determined if the data it contains have been recorded into scalar data that adopt the following naming convention:

variable-name '§' index(N) '§' index(N-1) ... '§' index(0)

when dimension is N.

As an example:

<%set %CA_MONTH§0§0%="January" %>
<%set %CA_MONTH§1§0%="502,000 $" %>
<%set %CA_MONTH§0§1%="February" %>
<%set %CA_MONTH§1§1%="120,000 $" %>
<%set %CA_MONTH§0§2%="March" %>
<%set %CA_MONTH§1§2%="340,000 $" %>
...
<%set %CA_MONTH§0§11%="December" %>
<%set %CA_MONTH§1§11%="1,200,000 $" %>

could store the actual benefit of a fairly healthed start up (not our lab indeed !!), and would further be fully specified by the following dimensioning variables :

<%set %CA_MONTH§C§C%="11" %>
<%set %CA_MONTH§C%="2" %>

The metavariables of the vectorial form will be extended to the upper dimensions:

  • The automated associated indexes : variable-name§I, variable-name§I§I... (as many dimensions).
  • Dimensioning variables (upper bounds of the array where stands effective data), variable-name§C, variable-name§C§C ... optional.
  • Eventual dimensioning variables for the lowest dimension (standing as the upper bound of the last dimension of the array as a vector), recorded into a N-1 dimension array which equivalent scalar keys should adopt the following form: variable-name '§C§' index(N-1) '§' index(N-2) ... index(0).

When all these metas are defined, the multidimensional array is fully specified.

The above syntax retrieves the value in a multidimensional array corresponding to actual values of automated indexes associated to the array. The general form for this call is:

variable_name[ variable_name§I, variable_name§I§I, ... variable_name§I§I...§I ]

Although it can be used in the main sequence of a DIML document, this syntax is essentially intended in templates definitions that will be further called iteratively. To have some benefit of all the dimensions of the array, an iterative imbrication for each dimension should be written, just as:

<TEMPLATE ID="rows">
<TR><%%cells[*]%%></TR>
</TEMPLATE>
 
<TEMPLATE ID="cells">
<TD><%%CA_MONTH[][]%%></TD>
</TEMPLATE>
 
<%set %rows% = %CA_MONTH§C§C% %>
<%set %cells% = %CA_MONTH§C% %>
<TABLE CELLSPACING=2 CELLPADDING=2>
<%%rows[*]%%>
</TABLE>

scalar-formatters: This statement has scalar resolution, formatting attributes of the basic scalar call are applicable.


previous summary next


All material is copyleft V.G. FREMAUX (EISTI France) 1999 to 2003 except explicitly mentioned