Accessing the current value of a D2000 system object is allowed by the function D2_GetValue.
D2_GetValue(objName, attribute, refresh) |
objName |
TEXT type |
Object name. |
attribute | TEXT type |
Required object value attribute. |
refresh | Optional parameter. |
The optional parameter Refresh is used to force the of the function computation. The
parameter has been implemented for the reason of the MS Excel method to calculate expressions in a cell.
Expressions will be calculated if:
The parameter Refresh allows to initialize calculating the expression.
= D2_GetValue("Sec", "") |
The expression gets the value of the object Sec right in the moment of computation. Reloading the current value can be performed only by manual editing of the expression.
Expression in cell:= D2_GetValue("Sec", "TIM") |
The function works analogous to the previous example, but its return value is the time of the object value (in D2000 system, there is an equivalent declaration Sec\TIM).
Both the expressions give one trouble: the cells containing such expressions will not be updated after opening the workbook. Their contents stay unchanged since last the cells was editing last time (and saving the workbook). Using the parameter Refresh eliminates the problem.
Expressions in cell:= D2_GetValue("Sec", "", A3) |
The function works analogous to the previous example. Using the optional parameter will provides for computation of the expression if the value of the cell A3 is changed.
If the following expression is typed into the cell A3:= NOW() |
the expression D2_GetValue(“Sec”, “”, A3) will be computed also when the workbook is opening.
For the parameter Refresh, it is appropriate to use the reference to the cell D2000_BT (the cell is automatically computed when the workbook is opening – see the topic Predefined cells).