Go to: Articles List

SubRoutines vs. Functions Part 2 : How to pass values in to a Sub or Function

To pass values in to subroutines or functions simply specify them in between the parenthesis of the function you are calling. Passing values to subroutines and functions works the same way for both. An example of the syntax is:

NameOfFunction(parameter1, parameter2)

or

CheckForChar(eaddress, "@")

     You can pass values to functions by reference or by passing the value explicitly. To pass a value by reference simply pass in the name of the variable.

Example:

MyFunction(VarName1)

     Or you can pass in the value explicitly, like this:

MyFunction("Brinkster")