Friends,
You can only make this kind of
discovery if you screw up. Look at the code and tell me what
value you will get with
xVar := oHtml:getVar(
"MY_VARx")
<form name="the_form"
action="..." onsubmit="return true" method="get">
<input type="hidden" name="MY_VAR1" value="1"
/>
<input type="hidden" name="MY_VAR1" value="2"
/>
<input type="hidden" name="MY_VAR1" value="3"
/>
<input type="hidden" name="MY_VAR1" value="4"
/>
<p>
Test 1 <input type="text" name="MY_VAR2"
size="1" /><br />
Test 2 <input type="text" name="MY_VAR2"
size="1" /><br />
Test 3 <input type="text" name="MY_VAR2"
size="1" /><br />
Test 4 <input type="text" name="MY_VAR2"
size="1" /></p>
<p><input type="submit" value="Submit"
/></p>
</form>
If you don't know, I will save you
the trouble of running the code. Assuming standard typing, in
both cases xVar := { "1", "2", "3", "4" } I did not know this
and I have not seen it in any of the references I can find
on-line. Granted, this is a stupid piece of code, but it also
means that this will work in WAA and you will get back arrays,
which are easy to handle for data storage, etc.:
do while .not. MY_FILE->(
eof())
oHtml:put(
'<input type="hidden" name="MY_VAR1" value="' +
MY_FILE->KEYFIELD + '" />')
oHtml:put(
'<input type="text" name="MY_VAR2" value="' + MY_FILE->NAME +
'" />')
MY_FILE->(
dbskip())enddo
This simplifies a lot of coding for me.
Bruce Anderson
IBSWTMWIW