An output argument check script belongs to a command output argument and checks if the value of the output argument is valid, after executing the command.
![]() | Note |
|---|---|
To check several, mutually dependant output arguments, instead of the value of a single output argument, the command out_check script should be used instead of the command output argument check script. See the section called “Command out_check script” for checking several mutually dependant output arguments. |
Table 7.13. Output argument check script selector
| Production | Syntax | Links |
|---|---|---|
output_argument_check_script_selector | command_id "." output_argument_id "." "check" | the section called “Output argument check script” |
This script always has a first input argument that holds the value to be checked. The id suffix and type of this input argument are the same as those of the command's output argument.
Moreover, as the checks done in this script sometimes depend on input argument values, all input arguments of the command are also implicitly provided as input arguments for this script
Finally, if the script belongs to an object (i.e. it is defined in a type) then an additional last input argument holds a reference to the object. This argument's id is i_object_, and its type is the type of the object. i_object_ is used whenever the object's state must be considered in the script. If the script belongs to a service then no such input argument exists.
This script always has one output argument whose id is o_error and whose type is ty_error_check_output_argument. o_error is void if the command's output argument (which is an input argument for this script) is valid. Otherwise it returns an error describing the first check that failed.
Example 7.2. Output argument check script example
service script_examples
command append_string_to_string
in string type:string end
in append type:string end
out result type:string check: i_result.item_count =v i_string.item_count + i_append.item_count end
script
o_result = i_string & i_append
end
end
end