VB.Net Tutorial/Class Module/Named Parameters — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 16:40, 26 мая 2010

Use named parameters

Option Strict On
Public Class Person
   Private firstName As String
   Private middleName As String
   Private lastName As String
   Public Sub New(firstName As String, middleName As String , lastName As String)
      Me.firstName = firstName
      Me.middleName = middleName
      me.lastName = lastName
   End Sub
End Class
Public Module CallingFunctions
   Public Sub Main()
      Dim person2 As New Person("John", "J.", "Smith")
      Dim person1 As New Person(firstName := "John", lastName := "Smith", middleName := "J.")
   End Sub
End Module