
Passing array from ASP (VBScript) to DLL and back
This probably isn't the best way, you aren't actually passing an array back
and forth, but is the only way I know how. What you do is convert your
array into a delimited string.
array(1) = "a" == strVar = "a,b,c"
array(2) = "b"
array(3) = "c"
You can pass the info to the DLL this way. Inside the DLL, use the
Split(expression[, delimiter[, count[, compare]]]) function to separate the
values back into an array.
http://msdn.microsoft.com/scripting/vbscript/doc/vsfctSplit.htm
Do the same when passing an array from the DLL to the asp page.
This also works great if you don't want to specify how long an array has to
be. If you are creating an array that could hold 9 records or 999, why use
the memory and dim array(999) and then get an error if you go over (ReDiming
sucks). Just create one variable with delimited data and split it into an
array.
Hope this helps.
Craig Kohtz
http://www.periodically.com
Quote:
> I am trying to port an application from VB (Std. EXE) to the web via ASP
and
> using a DLL in an attempt to share as much code as possible. My problem is
> returning a variable to the ASP page for use in a VBScript routine. Any
> clues or pointers?