Събитие
Създаване на интелигентни приложения
17.03, 23 ч. - 21.03, 23 ч.
Присъединете се към поредицата срещи, за да изградите мащабируеми AI решения, базирани на реални случаи на употреба с колеги разработчици и експерти.
Регистрирайте се сегаТози браузър вече не се поддържа.
Надстройте до Microsoft Edge, за да се възползвате от най-новите функции, актуализации на защитата и техническа поддръжка.
You use a Function
procedure to return a value to the calling code.
Outside any other procedure, use a Function
statement, followed by an End Function
statement.
In the Function
statement, follow the Function
keyword with the name of the procedure, and then the parameter list in parentheses.
Follow the parentheses with an As
clause to specify the data type of the returned value.
Place the procedure's code statements between the Function
and End Function
statements.
Use a Return
statement to return the value to the calling code.
The following Function
procedure calculates the longest side, or hypotenuse, of a right triangle, given the values for the other two sides.
Function Hypotenuse(side1 As Double, side2 As Double) As Double
Return Math.Sqrt((side1 ^ 2) + (side2 ^ 2))
End Function
The following example shows a typical call to hypotenuse
.
Dim testLength, testHypotenuse As Double
testHypotenuse = Hypotenuse(testLength, 10.7)
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка:
Събитие
Създаване на интелигентни приложения
17.03, 23 ч. - 21.03, 23 ч.
Присъединете се към поредицата срещи, за да изградите мащабируеми AI решения, базирани на реални случаи на употреба с колеги разработчици и експерти.
Регистрирайте се сегаОбучение
Модул
Create C# methods that return values - Training
This module covers the return keyword and returning values from methods.
Документация
How to: Call a Procedure That Returns a Value - Visual Basic
Learn more about: How to: Call a Procedure That Returns a Value (Visual Basic)
How to: Call a Procedure that Does Not Return a Value - Visual Basic
Learn more about: How to: Call a Procedure that Does Not Return a Value (Visual Basic)
Function procedures - Visual Basic
Learn more about: Function procedures (Visual Basic)