Re: ASP: server and client variables

by Charlotte Gardner <vgardner(at)mindspring.com>

 Date:  Sun, 09 Jan 2000 16:20:57 -0500
 To:  hwg-languages(at)hwg.org
 In-Reply-To: 
  todo: View Thread, Original
Romek wrote:
>  Not expert in VBScript, but what I remember from  my BASIC
>  times  you have to put dimensions to nLdrs array declaration
>  and index when assigning single value to it.
>
> DIM nLdrs(1)
> nLdrs(0) = 4


Actually, the two variables I'm passing are a number, nLdrs,
and an array, aLdrs(4) .

I'm able to pass the number to the javascript function but I have 
not been able to pass the entire aLdrs array, which is what
I need to do.

Any suggestions, anyone?

Charlotte

----------------------------------------------------------------------------
-----------
>At 10:13 1/9/2000 -0500, you wrote:
>>Hello all,
>>
>>I'm working on a simple ASP script that will pass server-side variables 
>>(created in VBScript) to a client-side (javascript) function. 
>>
>>First I declare and initialize the variables:
>>
>>Dim nLdrs, aLdrs(4)
>>
>>nLdrs = 4
>
>  Not expert in VBScript, but what I remember from  my BASIC
>  times  you have to put dimensions to nLdrs array declaration
>  and index when assigning single value to it.
>
> DIM nLdrs(1)
> nLdrs(0) = 4
>
> Of course these times arrays can probably be dynamic
> but nevertheless you need to TELL TO WHICH ELEMENT OF
> THE ARRAY YOU PUT A VALUE
>
>>
>>aLdrs(0) = "5"
>>aLdrs(1) = "Doe, John"
>>aLdrs(2) = "555-123-1234"
>>aLdrs(3) = "jd(at)yahoo.com"
>>
>>Then I create a form with a single listbox. When the listbox's selection
>>changes, I want to pass the variables to the javascript function:
>>
>><.SELECT NAME="mySelect" onChange="swapLdrID(<%=nLdrs%>,<%=aLdrs%>);">
>>
>>When I pass the number variable only, everything is fine -- the number
>>shows up in 
>>the swapLdrID function. But when I try to pass the array, I get this error:
>>
>>error 'ASP 0106 : 80020005'
>>Type Mismatch
>>?
>>An unhandled data type was encountered.
>>
>>
>>Is it possible to pass an array this way? If so, what is the syntax?
>>Or, is there a better way to approach this?
>>
>>Thanks,
>>Charlotte
>--
>RJZ

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA