blob: 775ef4ce2a6792f0a5ddc80343b2a1647984e96f [file] [log] [blame]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>load_response</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Apache Rivet 3.1"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="load_headers.html" title="load_headers"><link rel="next" href="lremove.html" title="lremove"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">load_response</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="load_headers.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right"> <a accesskey="n" href="lremove.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="load_response"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>load_response — load form variables into an array.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::load_response</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>arrayName</code></em></span>?</div></div></div><div class="refsect1"><a name="idm1447"></a><h2>Description</h2><p style="width:90%">
Load any form variables passed to this page into an
array. If <span style="font-family:monospace"><span class="command"><strong>load_response</strong></span></span> is called without
arguments the array response is created in
the scope of the caller. If the variables var1,var2,var3...
having values val1,val2,val3... are passed to the page, the
resulting array will be a collection mapping var1,var2,var3...
to their corresponding values. <span style="font-family:monospace"><span class="command"><strong>load_response</strong></span></span>
was inspired by the same NeoWebScript procedure in the way
it deals with multiple assignments: if a variable
is assigned more than once the corresponding array element will be a
list of the values for the variable. This can be useful in the case
of forms with checkbox options that are given the same name.
This condition is signalled by the presence of an auxiliary array
variable.
</p><p style="width:90%">
Example: if a group of checkboxes are associated to the var1
variable then <span style="font-family:monospace"><span class="command"><strong>response(var1)</strong></span></span> will store
the list of their values and the array will also have the extra variable
response(__var1) which can be tested with
the usual <span style="font-family:monospace"><span class="command"><strong>[info exists response(__var1)]</strong></span></span>
</p><p style="width:90%">
Calling <span style="font-family:monospace"><span class="command"><strong>load_response</strong></span></span> several times for the same
array results in adding more values to the array at every call.
When needed it is left to the caller to empty the array between
two subsequent calls.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="load_headers.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="lremove.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">load_headers </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> lremove</td></tr></table></div></body></html>