F_IS_VALID_TIME

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Function Name : f_is_valid_time
// Argument Name : atm_source, Arg Type : Time, Pass By : Value
// Return Type : Boolean
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//    Description:      Given a time, will determine if the time is valid.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

integer     li_hour
integer    li_minute
integer    li_second

// Initialize test values.
li_hour = Hour(atm_source)
li_minute = Minute(atm_source)
li_second = Second(atm_source)

// Check for nulls.
If IsNull(atm_source) Or IsNull(li_hour) or IsNull(li_minute) or IsNull(li_second) Then
    Return False
End If

// Check for invalid values.
If li_hour < 0 or li_minute < 0 or li_second < 0 Then
    Return False
End If

// Passed all testing.
Return True

0 comments:

Post a Comment