VB 11 Tutorial 8: Getting Started
If you have not yet learnt about Math Syntax Please refer to Tutorial 7: Here
Today we will be learning how to use Variables By Reference
Code:
' Example of Using Variables By Reference
Module SubNew
Sub Main()
Dim OldPassword As String = "Old Password"
ChangeMyPassWord(OldPassword)
Console.WriteLine(OldPassword) ' It will Output "New Password", because it is referencing the variable we used before.
End Sub
Private Sub ChangeMyPassWord(Byref Password As String)
Password = "New Password"
End Sub
End Module
Today we will be learning how to use Variables By Reference
Code:
' Example of Using Variables By Reference
Module SubNew
Sub Main()
Dim OldPassword As String = "Old Password"
ChangeMyPassWord(OldPassword)
Console.WriteLine(OldPassword) ' It will Output "New Password", because it is referencing the variable we used before.
End Sub
Private Sub ChangeMyPassWord(Byref Password As String)
Password = "New Password"
End Sub
End Module
No comments:
Post a Comment