Click to See Complete Forum and Search --> : Passing Arrays between pages


rambovet
06-26-2003, 11:50 PM
HI guys--

Another question for you.

I have a form .asp page that is collecting many variables as well as an array set of variables, however when I try the post method to pass the array on I'm not able to get them transferred. My variables are transferring fine just no luck with the arrays... What am I doing wrong?

Sample of my code:

PAGE 1:
<% Language="VBScript"
dim RxNum(2) %>
<HTML>
<%
intOther= Request.QueryString("intOther") 'a dynamic
variable transferred from another page between 0 and 2

for count= 0 to intOther %>

Type in your Script Number<input type="text" name="aryRxNum(count)" size="8" maxlength="10" value="<%= aryRxNum(count) %>">

<% next %>
-------
PAGE 2: Views results from Page 1

<% Language="VBScript"
aryRxNum(0)=Request.Form("aryRxNum(0)") %>

<% response.write "Script #: "&aryRxNum(0) %>


...I keep getting a Type MisMatch error for Page 2. I assume it's because I'm not Dim my array. But won't that clear the variable? I can't figure out the proper context unless, of course, the Request.Form is the wrong Object for arrays.

Please help.
Thanks.

Andrew:confused:

vickers_bits
06-27-2003, 04:33 AM
page 2 cant request "aryRxNum(0)"
because the variable being passed is "aryRxNum(count)"
where count is a string, rather than a number

try this...
<input ... name="aryRxNum(<%= count %>)" ...

rambovet
06-27-2003, 07:41 AM
....ohhhhh....

yeah....that makes sense....


I knew it was something contextual...

Thank you.

Andrew:)