Optional Arguments

Many procedures accept a large number of arguments. Some of the arguments are required. Every required argument must be supplied or the script fails to run. Some arguments are optional. Optional arguments may be omitted and the procedure assumes a default value for the missing arguments.

 

For example, the ConnectModules option of the Construct method accepts six parameters (SourceModule, SourceModuleID, SourcePort, TargetModule, TargetModuleID, TargetPort), some of which are optional. This section of code shows the command with only the required options:

 

  CommandApi.Construct ("ConnectModules")

  CommandApi.Option("SourceModule", "GoldConcentration.dat")

  CommandApi.Option("TargetModule", "Gridder")

  CommandApi.Do()

 

Since the arguments are optional, you can skip all or some of them when calling the command.

 

 

See Also

Scripter BASIC Language