get_arg
Overloads
| Name | Description |
|---|---|
get_arg(const string name, as_bool type) -> bool | Returns the named script argument. |
get_arg(const string name, as_bool type, const bool default_value) -> bool | Returns the named script argument. |
get_arg(const string name, as_integer type) -> integer | Returns the named script argument. |
get_arg(const string name, as_integer type, const integer default_value) -> integer | Returns the named script argument. |
get_arg(const string name, as_real type) -> real | Returns the named script argument. |
get_arg(const string name, as_real type, const real default_value) -> real | Returns the named script argument. |
get_arg(const string name, as_complex type) -> complex | Returns the named script argument. |
get_arg(const string name, as_complex type, const complex default_value) -> complex | Returns the named script argument. |
get_arg(const string name, as_string type) -> string | Returns the named script argument. |
get_arg(const string name, as_string type, const string default_value) -> string | Returns the named script argument. |
get_arg(const string name, as_bool type) -> bool
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload throws an exception.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
Returns
Argument value converted to the requested type.
get_arg(const string name, as_bool type, const bool default_value) -> bool
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload returns the provided default value.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
- default_value: Value returned when the argument is not provided. Any valid value of the requested type may be used.
Returns
Argument value converted to the requested type, or default_value when absent.
Example
var count = get_arg("count", as_integer, 3)
var label = get_arg("label", as_string, "run")
get_arg(const string name, as_integer type) -> integer
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload throws an exception.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
Returns
Argument value converted to the requested type.
get_arg(const string name, as_integer type, const integer default_value) -> integer
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload returns the provided default value.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
- default_value: Value returned when the argument is not provided. Any valid value of the requested type may be used.
Returns
Argument value converted to the requested type, or default_value when absent.
Example
var count = get_arg("count", as_integer, 3)
var label = get_arg("label", as_string, "run")
get_arg(const string name, as_real type) -> real
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload throws an exception.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
Returns
Argument value converted to the requested type.
get_arg(const string name, as_real type, const real default_value) -> real
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload returns the provided default value.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
- default_value: Value returned when the argument is not provided. Any valid value of the requested type may be used.
Returns
Argument value converted to the requested type, or default_value when absent.
Example
var count = get_arg("count", as_integer, 3)
var label = get_arg("label", as_string, "run")
get_arg(const string name, as_complex type) -> complex
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload throws an exception.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
Returns
Argument value converted to the requested type.
get_arg(const string name, as_complex type, const complex default_value) -> complex
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload returns the provided default value.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
- default_value: Value returned when the argument is not provided. Any valid value of the requested type may be used.
Returns
Argument value converted to the requested type, or default_value when absent.
Example
var count = get_arg("count", as_integer, 3)
var label = get_arg("label", as_string, "run")
get_arg(const string name, as_string type) -> string
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload throws an exception.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
Returns
Argument value converted to the requested type.
get_arg(const string name, as_string type, const string default_value) -> string
Returns the named script argument.
Adding a get_arg call declares a script argument, which Forge exposes when triggering an execution or scheduling a job. Only the entry-point script is parsed for get_arg calls (included scripts are not supported yet). The same name may be used multiple times, but the first call determines the argument type, so use a consistent type for the same name. If the argument is missing, this overload returns the provided default value.
Parameters
- name: Argument name. Must be a string literal such as "mode" so Forge can prompt for a value; variables are not supported.
- type: Type tag: as_bool, as_integer, as_real, as_complex, or as_string.
- default_value: Value returned when the argument is not provided. Any valid value of the requested type may be used.
Returns
Argument value converted to the requested type, or default_value when absent.
Example
var count = get_arg("count", as_integer, 3)
var label = get_arg("label", as_string, "run")