Siebel VB Language Reference > Using Siebel VB > Guidelines for Using Siebel VB >

Give Each Argument a Name


If you use a function that includes an argument, then you can provide a value for this argument. To do this, you list it in the order where it occurs in the format for the function. For example, assume you define the following function:

myfunction(id, action, value)

In this example, the myfunction function requires the following arguments:

  • id
  • action
  • value

If you call this function, then you specify these arguments in the order that they occur. If a function includes multiple arguments, then it is recommended that you name each argument. This technique helps to make sure that Siebel CRM assigns each value that you specify to the correct argument.

If you give each argument a name, then you are not required to remember the order where the arguments occur. For example, the following format is correct even though the order varies from the order that the format specifies:

myfunction action:="get", value:=0, id:=1

Consider the following code:

Sub mysub(aa, bb, optional cc, optional dd)

The following calls to this code are equivalent to each other:

call mysub(1, 2, , 4)
mysub aa :=  1, bb :=  2, dd := 4
call mysub(aa :=  1, dd:= 4, bb :=  2)
mysub 1, 2, dd:= 4

Format That You Can Use to Name an Argument

To name an argument, you use the following format:

argname:= argvalue

where:

  • argname is the name of the argument that you specify in the Function statement or the Sub statement. For more information, see Create Function Method and Create Subroutine Method.
  • argvalue is the value that Siebel CRM assigns to the argument when your code calls it.

For example:

myfunction id:=1, action:="get", value:=0

Naming an Argument With More Complex Formats

With some formats, you must use a comma as a placeholder for each optional argument that you do not specify. If you name the arguments, then you can specify only the arguments that your code must use and their values. For example, consider the following code:

myfunction(id, action, value, Optional counter)

In this situation, you can use one of the following formats:

myfunction id:="1", action:="get", value:="0"

myfunction value:="0", counter:="10", action:="get", id:="1"

You cannot omit a required argument.

Where You Can Name an Argument

You can name an argument in the following situations:

  • Functions you define with the Function statement
  • Subroutines you define with the Sub statement
  • Code that you declare with the Declare Procedure statement
  • Some predefined functions and statements
  • Some externally registered DLL functions and methods
Siebel VB Language Reference Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.