public Structure CustomerBalance
Dim decBalSavings As Decimal
Dim decBalChecking As Decimal
End Structure
public class Test
public Shared Sub Main
Dim udtBalance As CustomerBalance
udtBalance = GetCustomerBalance(1)
Console.WriteLine(udtBalance.decBalChecking)
Console.WriteLine(udtBalance.decBalSavings)
End Sub
Shared Function GetCustomerBalance(ByVal intCustomerID As Integer) As CustomerBalance
Dim udtBalance As CustomerBalance
udtBalance.decBalChecking = CDec(1000 + 4000 * Rnd())
udtBalance.decBalSavings = CDec(1000 + 15000 * Rnd())
Return udtBalance
End Function
End class
|