|
|
|
Click here to copy the following block |
Function ArrayAny(ParamArray values() As Variant) As Variant Dim i As Long Dim maxEl As Long Dim res As Variant maxEl = UBound(values) If IsObject(values(0)) Then ReDim arrObj(0 To maxEl) As Object For i = 0 To maxEl Set arrObj(i) = values(i) Next ArrayAny = arrObj() Exit Function End If Select Case VarType(values(0)) Case vbInteger ReDim arrInt(0 To maxEl) As Integer res = arrInt() Case vbLong ReDim arrLng(0 To maxEl) As Long res = arrLng() Case vbSingle ReDim arrSng(0 To maxEl) As Single res = arrSng() Case vbDouble ReDim arrDbl(0 To maxEl) As Double res = arrDbl() Case vbCurrency ReDim arrCur(0 To maxEl) As Currency res = arrCur() Case vbString ReDim arrStr(0 To maxEl) As String res = arrStr() Case vbDate ReDim arrDat(0 To maxEl) As Date res = arrDat() Case vbBoolean ReDim arrBol(0 To maxEl) As Boolean res = arrBol() Case Else Err.Raise 5 End Select For i = 0 To maxEl res(i) = values(i) Next ArrayAny = res End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|