Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use VB.NET Neutron processes and functions

Shulou Source: shulou.com Published: 2022-06-02 08:49:01 11月28日 Update

Editor to share with you about the VB.NET neutron process and how to use the function, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

VB.NET subprocedures and functions can set parameters as needed. The only difference between them is that a function can have a return value while a subprocedure does not.

The definition of VB.NET subprocess and function subprocess is as follows:

Sub subname ([argument1]

[,... , argumentn]])

[statements]

End Sub

The calling method for VB.NET subprocedures and function subroutines is to directly call the procedure name subname. If there are parameters, write the parameters in parentheses later in order.

Example 2.11 (02-11.aspx) uses a subprocedure to display a greeting message to a user:

< script language="vb" runat="server">

Sub SayHello (strUserName

As String)

Response.Write ("Hello!"

& strUserName & "

< br>

")

End Sub

< /script>

< % SayHello("Cindy") %>

In the above example, there are the following points to explain:

(1) add a tag to the program code on lines 1-5.

(2) A SayHelo subprocedure is defined in lines 2-4. This procedure takes a parameter strUserName and outputs it on line 3.

(3) this subprocedure is called on line 7. When called, the value of the passed-in parameter is "Cindy".

Functions in VB.NET subprocedures and functions are defined as follows:

Function functionname

[argument1 [, …] , argumentn]])

[statements]

[Return value]

[statements]

End Function

For VB.NET subprocedures and functions in functions, the function name functionname () is called. If there are any parameters, write them in parentheses in order.

The above is all the contents of the article "how to use VB.NET neutron procedures and functions". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information macOS Xiaomi Shulou Technology