' Visual Basic 2008 9.0 .NET Examples - Introduction to Functions - Procedures and Functions : Module Exercise1Solution Sub Main() Console.WriteLine(GetResult(5, "+"c, 4)) Console.WriteLine(GetResult(5, "-"c, 4)) Console.WriteLine(GetResult(5, "*"c, 4)) ' Console.ReadLine() End Sub Function GetResult(ByVal value1 As Integer, _ ByVal operatorSymbol As Char, _ ByVal value2 As Integer) As Integer Select Case operatorSymbol Case "+"c GetResult = value1 + value2 Case "-"c GetResult = value1 - value2 Case "*"c GetResult = value1 * value2 End Select End Function End Module ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.