|Bookshelf Home | Contents | Index | PDF|
When you call a subroutine or function that takes arguments, you usually supply values for those arguments by listing them in the order shown in the syntax for the statement or function. For example, suppose you define a function this way:
From the preceding syntax, you know that the function called myfunction requires three arguments: id, action, and value. When you call this function, you supply those arguments in the order shown. If the function contains just a few arguments, you can remember their order with ease. However, if a function has several arguments, and you want to be sure the values you supply are assigned to the correct arguments, use named arguments.
The area in which named arguments have a significant advantage is in calls to functions or subprograms that have a mix of required and optional arguments. Ordinarily, you need to use commas as placeholders in the syntax for the optional arguments that you do not use. However, with named arguments you can specify just the arguments you want to use and their values without regard to their order in the syntax. For example, if myfunction is defined as:
NOTE: Although you can shift the order of named arguments, you cannot omit required arguments. Siebel VB functions and statements accept named arguments. The argument names are listed in the syntax for each statement and function.
|Siebel VB Language Reference|