What are the differences between the following:
When should each one be used?
A sub performs a task but does not return a value. A function returns a value of the tasks performed. Subs can be recalled from anywhere in the program and in multiple types. Functions are called by a variable.
What Does Private Mean? Private Sub sets the scope so that subs in outside modules cannot call that particular subroutine. This means that a sub in Module 1 could not use the Call method to initiate a Private Sub in Module 2. (
A Sub procedure is a series of Visual Basic statements enclosed by the Sub and End Sub statements. The Sub procedure performs a task and then returns control to the calling code, but it does not return a value to the calling code.
A Sub procedure is a separate set of codes that are used in VB.NET programming to execute a specific task, and it does not return any values. The Sub procedure is enclosed by the Sub and End Sub statement.
Private is a modifier than gives the scope of the class, sub, or function.
A sub and a function are both subroutines, or sections of code that can be called in the program. The difference between them is that a function has a return value and a sub does not.
A class is a group of codes that can include subs, functions, and other stuff.
Sub is like a function but it doesnt returns any values it just executes a proccess
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With