Advertisement

09.09.2006 at 07:51AM PDT, ID: 21983540
[x]
Attachment Details

Pass Array to Sub Routine

Asked by bharvfor in Active Server Pages (ASP)

Tags: array, pass, vbscript, sub

I'm trying to pass an array to a Sub from the onclick event of a button --  I'm getting a type mismatch error.

Here is the code for the buttion

<input type=button language=vbscript value=create onclick="myproc <%=aMyArray%>" id=button1>

Here is the Sub I am passing the array to:

<script language='vbscript'>
Sub myproc(aPassed)
 
Dim strFeedback

For i = lbound(aPassed) to ubound(aPassed)
     strFeedback = strFeedback & aPassed(i)
Next

Msgbox strFeedback

End Sub
</script>

aMyArray is a valid array -- I write it to screen before calling the function to verify that it is formatted correctly

I've tried several different ways of calling the sub, but to no avail.  I've tested calling the sub with different params and it works fine.  But when I try to pass an array it bonks with the mismatch error.

Any help would be appreciated

Thanks BrianStart Free Trial
[+][-]09.09.2006 at 08:54AM PDT, ID: 17486204

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.09.2006 at 09:20AM PDT, ID: 17486444

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.09.2006 at 10:12AM PDT, ID: 17486603

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.09.2006 at 10:35AM PDT, ID: 17486662

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: array, pass, vbscript, sub
Sign Up Now!
Solution Provided By: alorentz
Participating Experts: 6
Solution Grade: A
 
 
[+][-]09.09.2006 at 12:31PM PDT, ID: 17486941

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.09.2006 at 05:30PM PDT, ID: 17487717

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.10.2006 at 06:37PM PDT, ID: 17491269

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.10.2006 at 06:55PM PDT, ID: 17491308

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32