Click to See Complete Forum and Search --> : Calling my Class DLL (using VBScript)


John K.
03-23-2000, 11:06 PM
My ASP calls my DLL, which searches through the files in a certain directory
and looks for a certain text string.
When I try his from a normal Visual Basic application, everything works just
fine, and the string array Sida() is filled with filenames that contain the
specified text.
So there's nothing wrong with my DLL.

However, when I try to do the same thing from my ASP page, the following
line invokes the error: "Subscript Out Of Range".
______________________
call objcls.filecontentsearch(Sida(), iCount,
request.servervariables("path_translated"), "*.*", sText)
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Why is that? My guess is that VBScript can't receive a whole array of string
(Sida()), like VB can. But that really don't help me=)
Anyone knows how I should proceed in order to get around this problem?

Pls help.

Thanks!

sergey
03-24-2000, 07:16 PM
Not sure about this but Try not declaring Sida as an array, instead of
Dim Sida()
use
Dim Sida
And make sure that in you VB function that parameter declared as variant.

hope that helps,
Sergey..

"John K." <john.k@home.se> wrote:
>My ASP calls my DLL, which searches through the files in a certain directory
>and looks for a certain text string.
>When I try his from a normal Visual Basic application, everything works
just
>fine, and the string array Sida() is filled with filenames that contain
the
>specified text.
>So there's nothing wrong with my DLL.
>
>However, when I try to do the same thing from my ASP page, the following
>line invokes the error: "Subscript Out Of Range".
>______________________
>call objcls.filecontentsearch(Sida(), iCount,
>request.servervariables("path_translated"), "*.*", sText)
>ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
>Why is that? My guess is that VBScript can't receive a whole array of string
>(Sida()), like VB can. But that really don't help me=)
>Anyone knows how I should proceed in order to get around this problem?
>
>Pls help.
>
>Thanks!
>
>

Syncwave
03-28-2000, 02:34 AM
VB Supports more data types, VBScript only supports variants. If your VB
DLL uses a string array, call it by value from ASP.

I use arrays a lot to hold read-only forward only disconnected recordset
data and enumerate through the values Byval.

"sergey" <skats@newworldsys.com> wrote:
>
>Not sure about this but Try not declaring Sida as an array, instead of
>Dim Sida()
>use
>Dim Sida
>And make sure that in you VB function that parameter declared as variant.
>
>hope that helps,
>Sergey..
>
>"John K." <john.k@home.se> wrote:
>>My ASP calls my DLL, which searches through the files in a certain directory
>>and looks for a certain text string.
>>When I try his from a normal Visual Basic application, everything works
>just
>>fine, and the string array Sida() is filled with filenames that contain
>the
>>specified text.
>>So there's nothing wrong with my DLL.
>>
>>However, when I try to do the same thing from my ASP page, the following
>>line invokes the error: "Subscript Out Of Range".
>>______________________
>>call objcls.filecontentsearch(Sida(), iCount,
>>request.servervariables("path_translated"), "*.*", sText)
>>ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
>>Why is that? My guess is that VBScript can't receive a whole array of string
>>(Sida()), like VB can. But that really don't help me=)
>>Anyone knows how I should proceed in order to get around this problem?
>>
>>Pls help.
>>
>>Thanks!
>>
>>
>

jy
03-31-2000, 11:50 AM
Rather late but just a thought: VB uses 0-based arrays, but doesn't VBScript
start from 1? -> The zeroth element of the array would be out of range,
or you might end up counting past the end of the array.

"Syncwave" <syncwave@intecdata.com> wrote:
>
>VB Supports more data types, VBScript only supports variants. If your VB
>DLL uses a string array, call it by value from ASP.
>
>I use arrays a lot to hold read-only forward only disconnected recordset
>data and enumerate through the values Byval.
>
>"sergey" <skats@newworldsys.com> wrote:
>>
>>Not sure about this but Try not declaring Sida as an array, instead of

>>Dim Sida()
>>use
>>Dim Sida
>>And make sure that in you VB function that parameter declared as variant.
>>
>>hope that helps,
>>Sergey..
>>
>>"John K." <john.k@home.se> wrote:
>>>My ASP calls my DLL, which searches through the files in a certain directory
>>>and looks for a certain text string.
>>>When I try his from a normal Visual Basic application, everything works
>>just
>>>fine, and the string array Sida() is filled with filenames that contain
>>the
>>>specified text.
>>>So there's nothing wrong with my DLL.
>>>
>>>However, when I try to do the same thing from my ASP page, the following
>>>line invokes the error: "Subscript Out Of Range".
>>>______________________
>>>call objcls.filecontentsearch(Sida(), iCount,
>>>request.servervariables("path_translated"), "*.*", sText)
>>>ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
>>>Why is that? My guess is that VBScript can't receive a whole array of
string
>>>(Sida()), like VB can. But that really don't help me=)
>>>Anyone knows how I should proceed in order to get around this problem?
>>>
>>>Pls help.
>>>
>>>Thanks!
>>>
>>>
>>
>