Subversion Repositories wimsdev

Rev

Rev 5921 | Rev 15649 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5921 Rev 7809
Line 2... Line 2...
2
<h4>Definition and substitution of variables</h4>
2
<h4>Definition and substitution of variables</h4>
3
 
3
 
4
Wims variables has only one type: they are all string variables. Numerical
4
Wims variables have only one type: they are all string variables. Numerical
5
evaluation can be done on variables via the variable command
5
evaluation can be done on variables via the variable command
6
$(ref1)cmdlist_eval_&+cmd_choose=all$(ref2)cmdlist_eval_">!eval</a>.
6
$(ref1)cmdlist_eval_&+cmd_choose=all$(ref2)cmdlist_eval_">!eval</a>.
7
<p>
7
<p>
8
A variable may be defined or modified in a variable processing file, or by
8
A variable may be defined or modified in a variable processing file, or by
9
the commands
9
the commands
10
$(ref1)cmdlist_let_&+cmd_choose=all$(ref2)cmdlist_let_">!let</a> and
10
$(ref1)cmdlist_let_&+cmd_choose=all$(ref2)cmdlist_let_">!let</a> and
11
$(ref1)cmdlist_default_&+cmd_choose=all$(ref2)cmdlist_default_">!default</a>.
11
$(ref1)cmdlist_default_&+cmd_choose=all$(ref2)cmdlist_default_">!default</a>.
12
</p><p>
12
</p><p>
13
Variable names can contain any alphanumeric character, as well as the
13
Variable names can contain any alphanumeric character, as well as the
14
underscore character $(emph)_$emphend. There is a limit to the length of
14
underscore character $(emph)_$emphend. There is a limit to the length of
Line 61... Line 61...
61
  $(emph)a1$emphend has value $(emph)3$emphend and <br/>
61
  $(emph)a1$emphend has value $(emph)3$emphend and <br/>
62
  $(emph)a2$emphend has value $(emph)pi$emphend, <br/>
62
  $(emph)a2$emphend has value $(emph)pi$emphend, <br/>
63
  then the string<pre>
63
  then the string<pre>
64
  $$(a$$[$$i-1])*x+$$(a$$[$$i-2])</pre>will become<pre>
64
  $$(a$$[$$i-1])*x+$$(a$$[$$i-2])</pre>will become<pre>
65
  pi*x+3</pre>after substitution.
65
  pi*x+3</pre>after substitution.
66
 </li><li>If the value of a variable being substituted contains the character
66
 </li><li>If the value of a variable being substituted contains the character
67
  $emph$$$emphend, this value will again be substituted, until no more
67
  $emph$$$emphend, this value will again be substituted, until no more
68
  substitution is needed. The server has a built-in limit of nested
68
  substitution is needed. The server has a built-in limit of nested
69
  substitutions; infinite nested substitions will violate this limit and
69
  substitutions; infinite nested substitions will violate this limit and
70
  generate an error message.
70
  generate an error message.
71
  </li>
71
  </li>
Line 101... Line 101...
101
  original meaning will be lost.
101
  original meaning will be lost.
102
 </li><li>The variable $emph module_dir$emphend has a value preset to the directory
102
 </li><li>The variable $emph module_dir$emphend has a value preset to the directory
103
  of the current module (with respect to the public home directory of the
103
  of the current module (with respect to the public home directory of the
104
  server). This value is usually $emph $$module_dir=module/$$module $emphend
104
  server). This value is usually $emph $$module_dir=module/$$module $emphend
105
  (but may vary with the config of the installation).
105
  (but may vary with the config of the installation).
106
 </li><li>Variable names starting with $emph module_$emphend will have special
106
 </li><li>Variable names starting with $emph module_$emphend will have special
107
  meanings: they are used to hold variables defined in the module's INDEX
107
  meanings: they are used to hold variables defined in the module's INDEX
108
  file. Currently implemented variables:
108
  file. Currently implemented variables:
109
 
109
 
110
  $table_header
110
  $table_header
111
  $table_tr<th> Variables</th><th>Meaning</th></tr>
111
  $table_tr<th> Variables</th><th>Meaning</th></tr>
Line 127... Line 127...
127
   $table_tr<td>$emph module_keywords$emphend</td><td>keywords, to be placed in the html header</td></tr>
127
   $table_tr<td>$emph module_keywords$emphend</td><td>keywords, to be placed in the html header</td></tr>
128
   $table_tr<td>$emph module_scoring$emphend</td><td>= yes if the module gives scores according to wims standard</td></tr>
128
   $table_tr<td>$emph module_scoring$emphend</td><td>= yes if the module gives scores according to wims standard</td></tr>
129
   $table_tr<td>$emph module_data$emphend</td><td>address of datamodule</td></tr>
129
   $table_tr<td>$emph module_data$emphend</td><td>address of datamodule</td></tr>
130
 
130
 
131
  </table>
131
  </table>
132
  Also, variables $emph module_has_intro$emphend,
132
  Also, variables $emph module_has_intro$emphend,
133
  $emph module_has_help$emphend and
133
  $emph module_has_help$emphend and
134
  $emph module_has_about$emphend
134
  $emph module_has_about$emphend
135
  have value "yes" if the module's directory contains the respective
135
  have value "yes" if the module's directory contains the respective
136
  .phtml file. These variables are used in the command <span class="tt">!homeref</span>.
136
  .phtml file. These variables are used in the command <span class="tt">!homeref</span>.
137
 </li><li>Certain environment variables setup by httpd are readable by wims
137
 </li><li>Certain environment variables setup by httpd are readable by wims
138
  modules under names starting with $emph httpd_$emphend. For example, the
138
  modules under names starting with $emph httpd_$emphend. For example, the
139
  environment variable $emph REMOTE_HOST$emphend becomes
139
  environment variable $emph REMOTE_HOST$emphend becomes
140
  $emph httpd_REMOTE_HOST$emphend under wims. <br/>
140
  $emph httpd_REMOTE_HOST$emphend under wims. <br/>
141
  Please refer to httpd protocol specifications for details of such variables.
141
  Please refer to httpd protocol specifications for details of such variables.
142
 </li><li>All variable names starting with $emph ins_$emphend, $emph
142
 </li><li>All variable names starting with $emph ins_$emphend, $emph
143
  insplot_$emphend, $emph instex_$emphend will have special meanings for the
143
  insplot_$emphend, $emph instex_$emphend will have special meanings for the
144
  corresponding dynamic insertion engines. A module should read or write them
144
  corresponding dynamic insertion engines. A module should read or write them