As we all know, ASP is a non-typed scripting language, while DLL components developed by VB, Vc, Delphi and other languages are all strongly typed, which leads to a problem. this will cause problems. let me talk about the problem I encountered. I use VB to write a test class and there is a method FUNA. the return value of the method FUNA is an array, for example: Code :
Class test:
Public Function getstr ()
Getstr = Split ("a, B, c, d ",",")
End Function
ASP code:
Dim o
Set o = server. Createobject ("bqrm. test ")
Dim arr
Arr = O. getstr ()
Response. Write (typename (ARR) 'output string ()
Response. Write (isarray (ARR) 'outputs true
Response. Write (ARR (0) 'output type does not match. isarray returns an array, but you cannot treat it as an array.
But the code of the getstr method can be used, for example:
Public Function getstr ()
Getstr = array ("A", "B", "C", "D ")
End Function
In this way, no errors will occur. However, sometimes you cannot list all the elements, so you have to write a function and convert it into a non-type array,
Function getvbsarray (byval ARR)
If isarray (ARR) then
Dim arrtmp ()
Redim arrtmp (ubound (ARR ))
Dim ibound
Ibound = 0
Dim TMP
For each TMP in arr
Arrtmp (ibound) = TMP
Ibound = ibound + 1
Next
Getvbsarray = arrtmp
Erase arrtmp
Else
Getvbsarray = arr
End if
End Function
Put it in a module, and convert it to the following before returning the array method:
Public Function getstr ()
Getstr = getvbsarray (split ("a, B, c, d ",","))
End Function
In this way, there is no problem.
BTW, however, in the past, I thought it was a very difficult problem. In fact, I was blindfolded by my ignorance. I only know a bit about vbs, but I don't know about VC and Delphi. I don't want to talk about that anymore, saving my b4 ....... pai_^