-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathArrayHelper.cls
More file actions
89 lines (77 loc) · 2.49 KB
/
ArrayHelper.cls
File metadata and controls
89 lines (77 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "ArrayHelper"
Attribute VB_GlobalNameSpace = True
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'//////////////////////////////////////////////////////////////////////////////
'@@summary
'@@require
'@@reference
'@@license
'@@author
'@@create
'@@modify
'//////////////////////////////////////////////////////////////////////////////
'------------------------------------------------------------------------------
' 公有常量
'------------------------------------------------------------------------------
'//////////////////////////////////////////////////////////////////////////////
'//
'// 类
'//
'//////////////////////////////////////////////////////////////////////////////
'------------------------------------------------------------------------------
' 初始化
'------------------------------------------------------------------------------
Private Sub Class_Initialize()
'
End Sub
'------------------------------------------------------------------------------
' 销毁
'------------------------------------------------------------------------------
Private Sub Class_Terminate()
'
End Sub
'//////////////////////////////////////////////////////////////////////////////
'//
'// 公有属性
'//
'//////////////////////////////////////////////////////////////////////////////
'//////////////////////////////////////////////////////////////////////////////
'//
'// 公有方法
'//
'//////////////////////////////////////////////////////////////////////////////
Public Function StringArray(ParamArray arr()) As String()
Dim a() As String
Dim i As Integer
ReDim a(UBound(arr))
For i = LBound(arr) To UBound(arr)
If VarType(arr(i)) <> vbString Then
Err.Raise 104, , "[SunSoft]参数非String,请检查代码!"
End If
a(i) = CStr(arr(i))
Next i
StringArray = a
End Function
Public Function IntegerArray(ParamArray arr()) As Integer()
Dim a() As Integer
Dim i As Integer
ReDim a(UBound(arr))
For i = LBound(arr) To UBound(arr)
If VarType(arr(i)) <> vbInteger Then
Err.Raise 104, , "[SunSoft]参数非Integer,请检查代码!"
End If
a(i) = CStr(arr(i))
Next i
IntegerArray = a
End Function