Difference between revisions of "CAObject::Result"
Line 3: | Line 3: | ||
= Description = | = Description = | ||
− | Returns the result of evaluating a variable as a | + | Returns the result of evaluating a variable as a variant. This is convenient when you know the result is a scalar (a non-array), since you obtain the result directly as a number, text, etc. If the result is an array, the array is collapsed into a representation of the array, which is usually not very convenient. If the result might be array-valued, it is usually preferable to use [[CAObject::ResultTable|ResultTable]] instead. |
− | The result | + | The [[CAObject::ResultType]] property controls which result is computed ([[Mid]], [[Mean]], etc.). The other possible [[CAObject::ResultType|ResultType]]s are usually array-valued, hence not used very often with this method. |
− | If the variable has not yet been evaluated, it is evaluated when this method is called. If this requires a lengthy calculation, the call will take a long time to complete. | + | If the variable has not yet been evaluated, it is evaluated when this method is called. If this requires a lengthy calculation, the call will take a long time to complete. When [[CAObject::MethodEvaluationTimeLimit]] is set, then the result aborts if the time limit expires and [[CAEnging::ErrorCode|ErrorCode]] is 77. |
If an error occurs during evaluation, the [[CAEngine::ErrorCode|ErrorCode]] will be set to something other than 0 or 2. If a warning occurs during evaluation, a result will be returned and the [[CAEngine::ErrorCode|ErrorCode]] will be 2. The [[CAEngine::OutputBuffer|OutputBuffer]] contains the error message or warning. | If an error occurs during evaluation, the [[CAEngine::ErrorCode|ErrorCode]] will be set to something other than 0 or 2. If a warning occurs during evaluation, a result will be returned and the [[CAEngine::ErrorCode|ErrorCode]] will be 2. The [[CAEngine::OutputBuffer|OutputBuffer]] contains the error message or warning. | ||
− | |||
= Data type = | = Data type = | ||
− | + | variant | |
= Access = | = Access = | ||
Line 23: | Line 22: | ||
<code> | <code> | ||
− | : | + | :res = obj.Result() |
</code> | </code> | ||
Line 31: | Line 30: | ||
: 0 - success | : 0 - success | ||
: 2 - warning | : 2 - warning | ||
− | : 37 - Could not retrieve result | + | : 12 - insufficient memory |
+ | : 37,38 - Could not retrieve result | ||
+ | : 77 - [[CAObject::MethodEvaluationTimeLimit|MethodEvaluationTimeLimit]] exceeded | ||
+ | : 78 - Computation aborted | ||
= See Also = | = See Also = |
Revision as of 17:48, 4 February 2015
Description
Returns the result of evaluating a variable as a variant. This is convenient when you know the result is a scalar (a non-array), since you obtain the result directly as a number, text, etc. If the result is an array, the array is collapsed into a representation of the array, which is usually not very convenient. If the result might be array-valued, it is usually preferable to use ResultTable instead.
The CAObject::ResultType property controls which result is computed (Mid, Mean, etc.). The other possible ResultTypes are usually array-valued, hence not used very often with this method.
If the variable has not yet been evaluated, it is evaluated when this method is called. If this requires a lengthy calculation, the call will take a long time to complete. When CAObject::MethodEvaluationTimeLimit is set, then the result aborts if the time limit expires and ErrorCode is 77.
If an error occurs during evaluation, the ErrorCode will be set to something other than 0 or 2. If a warning occurs during evaluation, a result will be returned and the ErrorCode will be 2. The OutputBuffer contains the error message or warning.
Data type
variant
Access
read
Usage
- res = obj.Result()
Errors Codes
This list is incomplete -- TBD
- 0 - success
- 2 - warning
- 12 - insufficient memory
- 37,38 - Could not retrieve result
- 77 - MethodEvaluationTimeLimit exceeded
- 78 - Computation aborted
Enable comment auto-refresher