
Passing Arrays into VbScript from a VB dll
You need the COM method to return an array of variants of subtype integer, not an array of strongly
typed integers. Script clients can't handle arrays of non-variants.
--
Michael Harris
MVP Scripting
Hi Michael,
Thanks for your reply its got me part of the way unfortunately now when I
try to reference the
array ie.
for i=0 to ubound(aspArray)
num = aspArray(i)
Loop
I get a type mistmatch error
Now I presume its something to do with the fact that its a variant but I'm
lost to how to deal with them.
Regards
Paul
Quote:
> You can't assign an array to an existing Dim'd array, but you can assigned
it to an individual
> element of such an array to a simple variant.
> In other words just do:
> Dim aspArray
> not
> Dim aspArray()
> --
> Michael Harris
> MVP Scripting
> Hi,
> This driving me crazy!!
> I have a VB dll that contains
> Public Function A() As Integer()
> Dim myArray(0 to 1000)
> ....
> A=myArray
> End Function
> Then an asp page which contains
> Dim aspArray()
> aspArray() = myArray()
> I keep getting the error "Subscript out of range"
> Can anyone help a beginner and show him the error of his ways.
> Thanks
> Paul Clements