Private Sub DivideOnErrRtnZeroVerify() ' Test the DivideOnErrRtnZero function. Debug.Assert DivideOnErrRtnZero(1.3, 2) = 0.65 Debug.Assert DivideOnErrRtnZero(1, 2) = 0.5 Debug.Assert DivideOnErrRtnZero(0, 2) = 0 Debug.Assert DivideOnErrRtnZero(-0.3, 2) = -0.15 Debug.Assert DivideOnErrRtnZero(1.3, 0) = 0 Debug.Assert DivideOnErrRtnZero(1, 0) = 0 Debug.Assert DivideOnErrRtnZero(0, 0) = 0 Debug.Assert DivideOnErrRtnZero(-0.3, 0) = 0 Debug.Assert DivideOnErrRtnZero(1.3, -2) = -0.65 Debug.Assert DivideOnErrRtnZero(1, -2) = -0.5 Debug.Assert DivideOnErrRtnZero(0, -2) = 0 Debug.Assert DivideOnErrRtnZero(-0.3, -2) = 0.15 ' Causes error inside function. Debug.Assert DivideOnErrRtnZero("Joe", 1) = 0 Debug.Assert DivideOnErrRtnZero(1, "Joe") = 0 ' Division supports Nulls. Debug.Assert IsNull(DivideOnErrRtnZero(Null, 1)) Debug.Assert IsNull(DivideOnErrRtnZero(1, Null)) End Sub
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.