asp调用dll二维数组函数时出现类型不匹配,急!

navysky 2010-07-17 02:13:30
用asp调用VB写的二维数组函数(dll)时,出现类型不匹配
Public Function getServerClassArray() As String()
ReDim cidsArrayList(3, 1) As String
cidsArrayList(0, 0) = "a"
cidsArrayList(0, 1) = "1"
cidsArrayList(1, 0) = "b"
cidsArrayList(1, 1) = "2"
cidsArrayList(2, 0) = "c"
cidsArrayList(2, 1) = "3"
cidsArrayList(3, 0) = "d"
cidsArrayList(3, 1) = "4"
getServerClassArray= cidsArrayList
End Function

asp 部分:
redim cidsArrayList(3,1)
cidsArrayList = fun.getServerClassArray()
此处提示:类型不匹配

应该如何调用VB写的二维数组呢?谢谢各位!
...全文
84 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wcwtitxu 2010-08-05
  • 打赏
  • 举报
回复

Public Function getServerClassArray() As Variant()
ReDim cidsArrayList(3, 1) As Variant
cidsArrayList(0, 0) = "a"
cidsArrayList(0, 1) = "1"
cidsArrayList(1, 0) = "b"
cidsArrayList(1, 1) = "2"
cidsArrayList(2, 0) = "c"
cidsArrayList(2, 1) = "3"
cidsArrayList(3, 0) = "d"
cidsArrayList(3, 1) = "4"
getServerClassArray = cidsArrayList
End Function




Dim cidsArrayList
cidsArrayList = fun.getServerClassArray()
navysky 2010-07-17
  • 打赏
  • 举报
回复
谢谢楼上的朋友,哪位高手可以给个建议
叫我梁大侠 2010-07-17
  • 打赏
  • 举报
回复
帮你顶下
yudoggy 2010-07-17
  • 打赏
  • 举报
回复

Public Function getServerClassArray() As Variable

先这样试试。如果还不行,就把数组作为一个参数以byref方式传进去

Public Function getServerClassArray(byref cidsArrayList As Variable) As Integer
ReDim cidsArrayList(3, 1) As String
....
' getServerClassArray= cidsArrayList 这行去掉
End Function

' 页面上
Dim cidsArrayList
Call fun.getServerClassArray(cidsArrayList)

mocom 2010-07-17
  • 打赏
  • 举报
回复
Dim cidsArrayList
cidsArrayList = fun.getServerClassArray()

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧