Difference between revisions of "IsResultComputed"
(Added InvalidateResult) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Special Functions]] | [[Category:Special Functions]] | ||
− | = IsResultComputed(X) = | + | == IsResultComputed(X) == |
− | Returns True (1) when the result value for variable | + | Returns True (1) when the result value for variable «X» has already been computed and is currently cached in memory, False (0) otherwise. |
− | When evaluated from [[Evaluation Modes|Mid-Mode]], it returns true when the Mid-value of | + | When evaluated from [[Evaluation Modes|Mid-Mode]], it returns true when the Mid-value of «X» is already computed. When evaluated from [[Evaluation Modes|Sample-Mode]], it returns true when the Sample-value of «X» is already computed. Hence, the following two forms test specifically for [[Mid]] or [[Sample]]: |
− | + | :<code>Sample(IsResultComputed(X))</code> | |
− | + | :<code>Mid(IsResultComputed(X))</code> | |
− | = Notes = | + | == Notes == |
+ | Generally if you attempt to read the value of the midValue or [[probValue]] attributes, using e.g., midValue of «X», it will trigger the computation of «X» if the value is not already computed. This function is required to circumvent this problem. | ||
− | + | === ADE === | |
− | |||
− | == ADE == | ||
From ADE, this function is also the method for testing whether a value is already computed and cached. You can do this either from typescript, e.g.: | From ADE, this function is also the method for testing whether a value is already computed and cached. You can do this either from typescript, e.g.: | ||
− | + | :<code>ade.SendCommand("IsResultComputed(Va1)")</code> | |
or you can use the CAObject::Evaluate method, e.g.: | or you can use the CAObject::Evaluate method, e.g.: | ||
− | + | :<code>CAObject va1 = ade.Get("Va1");</code> | |
− | + | :<code>if (va1.Evaluate("IsResultComputed(Va1)").AtomicValue()) {</code> | |
− | + | :<code>...</code> | |
− | + | :<code>}</code> | |
− | = See Also = | + | == See Also == |
+ | * [[Result]] | ||
+ | * [[MemoryInUseBy]] | ||
+ | * [[CompressMemoryUsedBy]] | ||
+ | * [[InvalidateResult]] |
Latest revision as of 16:35, 4 May 2016
IsResultComputed(X)
Returns True (1) when the result value for variable «X» has already been computed and is currently cached in memory, False (0) otherwise.
When evaluated from Mid-Mode, it returns true when the Mid-value of «X» is already computed. When evaluated from Sample-Mode, it returns true when the Sample-value of «X» is already computed. Hence, the following two forms test specifically for Mid or Sample:
Sample(IsResultComputed(X))
Mid(IsResultComputed(X))
Notes
Generally if you attempt to read the value of the midValue or probValue attributes, using e.g., midValue of «X», it will trigger the computation of «X» if the value is not already computed. This function is required to circumvent this problem.
ADE
From ADE, this function is also the method for testing whether a value is already computed and cached. You can do this either from typescript, e.g.:
ade.SendCommand("IsResultComputed(Va1)")
or you can use the CAObject::Evaluate method, e.g.:
CAObject va1 = ade.Get("Va1");
if (va1.Evaluate("IsResultComputed(Va1)").AtomicValue()) {
...
}
Enable comment auto-refresher