Public Function CreateTestClass(ClientValueIn As Variant, CWValueIn As Variant, test As String, Optional CWValue2 As Variant, Optional CWValue3 As Variant) As Variant
Dim Veh As Vehicle
Dim Result As Variant
Set Veh = New Vehicle
If IsNull(CWValueIn) Or IsNull(ClientValueIn) Then
CreateTestClass = 0
Exit Function
Else
Select Case test
Case "BHP"
Result = Veh.BhpRank(ClientValueIn, CWValueIn)
Case "KW"
Result = Veh.KWRank(ClientValueIn, CWValueIn)
Case "Character"
Result = Veh.CharacterRank(ClientValueIn, CWValueIn)
Case "KWStr"
Result = Veh.KWStrRank(ClientValueIn, CWValueIn)
Case "BPStrRank"
Result = Veh.BhpStrRank(ClientValueIn, CWValueIn)
Case "Engine"
Result = Veh.EngineRank(ClientValueIn, CWValueIn)
Case "CC"
Result = Veh.CCRank(ClientValueIn, CWValueIn)
Case "Fuel"
Result = Veh.FuelRank(ClientValueIn, CWValueIn)
Case "NomStr"
Result = Veh.NomStrRank(ClientValueIn, CWValueIn)
' Case "Nom"
' Result = Veh.NomRank(ClientValueIn, CWValueIn)
Case "GetstrNom"
Result = Veh.GetStrNomCC(ClientValueIn)
Case "GetstrNomRev"
Result = Veh.StrNomReverseRank(ClientValueIn, CWValueIn)
Case "GetValvesStr"
Result = Veh.GetStrValves(ClientValueIn)
Case "NomCalc"
Result = Veh.NomCalcRank(ClientValueIn, CWValueIn)
Case "Doors"
Result = Veh.DoorRank(ClientValueIn, CWValueIn)
Case "Valves"
Result = Veh.ValveRank(ClientValueIn, CLng(CWValueIn), CWValue2)
Case "ValvesRev"
Result = Veh.ValveReverseRank(ClientValueIn, CWValueIn)
Case "Drive"
Result = Veh.GetDrive(ClientValueIn)
Case "DriveRev"
Result = Veh.DriveReverseRank(ClientValueIn, CWValueIn)
Case "KeyWords"
Result = Veh.KeywordsRank(ClientValueIn, CWValueIn)
Case "Model"
Result = Veh.ModelRank(ClientValueIn, CWValueIn)
Case "Date"
Result = Veh.DateRank(ClientValueIn, CWValueIn, CWValue2, CWValue3)
End Select
End If
CreateTestClass = Result
End Function
'daterank function
Public Function DateRank(ClientIntroDateIn As Variant, CWIntroDateIn As Variant, Optional ClientTermdateIn As Variant, Optional CWTermdateIn As Variant) As Integer
Dim CWIntroDate As Date
Dim ClientIntroDate As Date
Dim CWTermDate As Date
Dim ClientTermDate As Date
Dim Counter As Integer
Dim ClientTermDateAvailable As Boolean
Dim CWTermDateAvailable As Boolean
Dim ClientintroDateAvailable As Boolean
Dim CWintroDateAvailable As Boolean
Dim AllTerminationDatesAvailable As Boolean
Dim AllintroDatesAvailable As Boolean
Dim AllDatesAvailable As Boolean
Dim IntroYearPass As Boolean
Dim TermYearPass As Boolean
Dim VarianceIntroYear As Integer
Dim VarianceTermYear As Integer
Dim LifeCycleExpired As Integer
Dim RemainingLifeCycle As Integer
Dim LifeCycleYears As Integer
end function
|