Jsp hosting - Use: Optional Program code to be executed within
Tuesday, January 30th, 2007Use: Optional Program code to be executed within the procedure. Description Defines a subroutine Rules at a Glance Subroutines cannot be nested; that is, you cannot define one subroutine inside another subroutine. (This applies to all procedures.) If you do not include one of the accessmodifier keywords, a subroutine will be Publicby default. Any number of ExitSub statements can be placed within the subroutine. Execution will continue with the line of code immediately following the call to the subroutine. If you specify an optional parameter in your subroutine declaration, you must also provide a default value for that parameter. For example: Private Sub ShowMessage(Optional sMsg _ As String = “Not given”) A subroutine is called by using its name and enclosing any arguments in parentheses. For example, a routine named SomeRoutine might be called as follows: x = 12 y = 12 SomeRoutine(x, y) Note that because it does not return a value, a subroutine cannot be assigned to a variable. For example, the following is illegal: z = SomeRoutine(x, y) Programming Tips and Gotchas There is often confusion between using the ByRef and ByVal methods of assigning arguments to the Sub procedure. ByRef assigns the reference of the variable in the calling procedure to the variable in the Sub procedure; that is, it passes a pointer containing the address in memory of the variable in the calling procedure. As a result, any changes made to the variable from within the Sub procedure are in reality made to the variable in the calling procedure. On the other hand, ByVal assigns the value of the variable in the calling procedure to the variable in the Sub procedure; that is, it makes a separate copy of the variable in a separate memory location. Changes made to the variable in the Sub procedure have no effect on the variable in the calling procedure. In general, ByRef arguments within class modules take longer to handle, since marshaling back and forth between Sub procedure and calling module must take place. So unless you explicitly need to modify a variable’s value within a Sub procedure, it’s best to pass parameters by value. VB .NET/VB 6 Differences If you do not specify whether an individual element in arglist is passed ByVal or ByRef, it is passed by reference in VB 6. In VB .NET, it is passed by value. If a parameter array is used in VB 6, it is an array of variants. In VB .NET, since the Variant is no longer supported, it must be an array of objects. In VB 6, a Sub procedure was called either by using the Call statement and including procedure arguments in parentheses or by using the name of the procedure and including
Quick Hint: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services