📄 clsstatistic.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "clsStatistic"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Dim fAve As Single
Dim fMax As Single
Dim fMin As Single
Public Function GetAverage(fData() As Single, RowCount As Integer) As Single
Dim i As Integer
Dim dSum As Double
For i = 1 To RowCount
dSum = dSum + fData(i)
Next i
GetAverage = dSum / RowCount
End Function
Public Function GetMax(fData() As Single, RowCount As Integer) As Single
Dim i As Integer
fMax = fData(1)
For i = 1 To RowCount
If fMax < fData(i) Then
fMax = fData(i)
End If
Next i
GetMax = fMax
End Function
Public Function GetMin(fData() As Single, RowCount As Integer) As Single
Dim i As Integer
fMin = fData(1)
For i = 1 To RowCount
If fMin > fData(i) Then
fMax = fData(i)
End If
Next i
GetMin = fMin
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -