[VB.NET]VB REDIM

VB.NET源码-156个实用实例哦…… VB REDIM
有段儿VB的代码,在参数设定初始值时,不知道它在做什么:
ReDim P_Value(0 To UBound(P_Name), 0 To Lotnum - 1) As Variant
P_Value(0, 0) = OrderNo
P_Value(1, 0) = WorkNo
P_Value(2, 0) = Dtl_No(0)
For j = 0 To Lotnum - 1
P_Value(3, j) = LotNo(j)
Next j
P_Value(4, 0) = Lotnum

ReDim P_Obj(0 To UBound(P_Name)) As Object
ReDim P_Flg(0 To UBound(P_Name)) As Boolean

For i = 0 To UBound(P_Name)
P_Flg(i) = False
If IsDBNull(P_Array(i)) Then
If Not CMNOracleParameters_Add(CStr(P_Name(i)), P_Value(i, 0), CInt(P_IO(i)), CInt(P_Type(i)), P_Obj(i)) Then
ErrCode = RTN_ORA
GoTo FUNC_ERR
End If
Else
ReDim P_WorkArray(0 To P_Array(i) - 1)
For j = 0 To P_Array(i) - 1
P_WorkArray(j) = P_Value(i, j)
Next j
If Not CMNOracleParameters_AddTable(CStr(P_Name(i)), CInt(P_IO(i)), CInt(P_Type(i)), CInt(P_Array(i)), CInt(P_Element(i)), P_WorkArray(), P_Obj(i)) Then
ErrCode = RTN_ORA
GoTo FUNC_ERR
End If
End If
P_Flg(i) = True
Next i

这段儿代码转到VB.NET应该怎样做,ReDim P_Value(0 To UBound(P_Name), 0 To Lotnum - 1)改怎么转,下面怎么使用
__________________________________________________________________________
array.resize

ding
__________________________________________________________________________
lz 去代码转换网站试试吧 应该是可以的
__________________________________________________________________________
ReDim P_Value(0 To UBound(P_Name), 0 To Lotnum - 1)
在.Net中也是这个用法呀,不需要转换的吧。
__________________________________________________________________________
ReDim P_Value(0 To UBound(P_Name), 0 To Lotnum - 1) 会报错
__________________________________________________________________________
什么错误?

Dim P_Value() as object
ReDim P_Value(0 To 10, 0 To 10)
__________________________________________________________________________
Dim P_Value() as object
ReDim P_Value(0 To 10, 0 To 10)
会报 ReDim 配列维数不可以改变
__________________________________________________________________________
昨儿一疏忽漏写逗号了。呵呵

Dim P_Value(,) As Object
ReDim P_Value(0 To 10, 0 To 10)
__________________________________________________________________________
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值