Private Sub plotPointBounce(ByVal monthRow As DataRow, ByVal seriesName As String) >> Dim dt As DateTime = DirectCast(monthRow("DT"), DateTime) >> plotPointBounce(dt, seriesName, 0, 0) >> End Sub >> >> Private Sub plotPointBounce(ByVal month As DateTime, ByVal seriesName As String, ByVal bounceRate As Double, _ >> ByVal inWarrantyRatio As Double) >> End Subthen you can call the second version directly with a different date and specific values for the last two parameters. Of course if you were always passing the same last two values from the first version you could make the final two parameters in the second version optional and drop them from the first version completely:
Private Sub plotPointBounce(ByVal monthRow As DataRow, ByVal seriesName As String) >> Dim dt As DateTime = DirectCast(monthRow("DT"), DateTime) >> plotPointBounce(dt, seriesName) >> End Sub >> >> Private Sub plotPointBounce(ByVal month As DateTime, ByVal seriesName As String, _ >> Optional ByVal bounceRate As Double = 0, Optional ByVal inWarrantyRatio As Double = 0) >> End Sub>
Private Sub plotPointBounce(ByVal monthRow As DataRow, ByVal seriesName As String) Dim dt As DateTime = DirectCast(monthRow("DT"), DateTime) Dim bounce As Double = DirectCast(monthRow("Bounce"), Double) Dim warranty As Double = DirectCast(monthRow("Warranty"), Double) plotPointBounce(dt, seriesName, bounce, warranty) End SubYou can just call that with plotPointBounce(dr,s) from multiple places. If you sometimes need to perform the same action but the data is in, say, an XmlElement then you can add a similar method that accepts the XmlElement instead of the DataRow.