Attribute VB_Name = "Output_Drive"
Function Level(ByVal In_1 As Integer, ByVal In_2 As Integer, ByVal In_3 As Integer, ByVal In_4 As Integer, ByVal Level_Num As Integer) As Integer
       
    Select Case Level_Num

    Case 1
    Level = In_1
    
    Case 2
    If In_1 > 0 And In_2 > 0 Then
            Level = In_1 * (In_2 / 255)
    Else
        Level = 0
    End If
    
    Case 3
    If In_1 > 0 And In_2 > 0 Then
        Level = In_1 * (In_2 / 255) * (In_3 / 255)
    Else
        Level = 0
    End If
    
    
    Case 4
    If In_1 > 0 And In_2 > 0 And In_3 > 0 And In_4 > 0 Then
        Level = In_1 * (In_2 / 255) * (In_3 / 255) * (In_4 / 255)
    Else
        Level = 0
    End If
    End Select
End Function

