If you specify an optional parameter in (Comcast webspace)
If you specify an optional parameter in your function declaration, you must also provide a default value for that parameter. For example: Private Function ShowMessage(Optional sMsg _ As String = “Not given”) Programming Tips and Gotchas There is often confusion between using the ByRef and ByVal methods to assign arguments to a function. ByRef assigns a reference of the variable in the calling procedure to the variable in the function; any changes made to the variable from within the function 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 function. Changes made to the variable in the function have no effect on the variable in the calling procedure. In general, ByRef arguments within class modules take longer to perform, since marshaling back and forth between function and calling module must take place; so unless you explicitly need to modify a variable’s value within a function, it’s best to pass parameters by value. Since a variable passed to a function by reference is actually modified by the function, you can use such variables to “return” multiple values from the function. VB .NET/VB 6 Differences If a parameter array is used in VB 6, it is a comma-delimited list of values in the calling procedure that is treated as an array of variants in the called function. In VB .NET, the arguments can be any data type, and they can be either an comma-delimited list of scalar values or an array. In VB 6, the elements in parameter arrays are passed by reference; in VB .NET, they are passed by value. 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. In VB 6, you can call a function that has arguments in a number of ways: x = SomeFunction(arg1, arg2) Call SomeFunction(arg1, arg2) SomeFunction arg1, arg2 In VB .NET, parentheses are required in the function call: x = SomeFunc(arg1, arg2) Call SomeFunc(arg1, arg2) SomeFunc(arg1, arg2) In VB 6, optional arguments do not require that you specify a default value. Instead, the IsMissing function is used to determine whether the optional argument is supplied (although in some cases it is unreliable). In VB .NET, you must assign a default value to an optional argument. See Also Sub Statement FV Function
Hint: If you are looking for high quality webhost to host and run your jsp application check Vision web hosting jsp services