Function的返回值类型可以是ArrayList的吗???
昨晚搞了一个购物车的类,定义了一个函数AddOrder :Public class OrderControl
'往购物车中添加药品订单信息
public Function AddOrder(byval NewDrug as Order,byval OrderCar as ArrayList) as ArrayList
dim obj as Order
dim Sign as Integer = 0
if OrderCar.Count = 0 then
OrderCar.Add(NewDrug)
return OrderCar
end if
for Each obj In OrderCar
if obj.DrugID = NewDrug.DrugID then
obj.DrugNum += 1
obj.TotalCharge = obj.Price*obj.DrugNum
return OrderCar
end if
next
OrderCar.Add(NewDrug)
return OrderCar
end function
但编译为DLL文件时,它提示错误:
error:未定义类型“ArrayList”。
public Function AddOrder(byval NewDrug as Order,byval OrderCar as ArrayList) as ArrayList
请问大家,这个问题怎么解决!!谢谢了~
[size=7]问题已经解决了,封帖,呵呵!![/size]
[[italic] 本帖最后由 blood_chen 于 2007-12-27 01:00 编辑 [/italic]]