SETATREFEXPR Function

Stores a value that is set through an action in the user interface (UI) or Automation.

Syntax

SETATREFEXPR ([ **expr_opt * ])

Parameters

Name Required/Optional Data Type Description
expr_opt
Optional
Varies
An expression that is replaced by the value or expression being assigned to the referenced cell in the SETATREF function. If not indicated, its initial value is 0 (zero).

Remarks

The value of a SETATREFEXPR expression can also be set from a SETATREF function in another cell that references the cell containing the SETATREFEXPR expression.

You are not limited to using the SETATREFEXPR function as a parameter to the SETATREF function.

Example 1

The following example uses the SETATREFEXPR function to ensure that a shape is as wide as its text.

Width =MAX(TEXTWIDTH(TheText),SETATREFEXPR())

Example 2

The following example shows how you can use the SETATREFEXPR function to cause your shapes to snap to a custom grid. The SETATREFEXPR formulas are placed in the PinX and PinY cells, causing the shape's pin to snap to the grid defined in User.GridX and User.GridY.

User.GridX =2 in

User.GridY =2 in

PinX =INT(SETATREFEXPR()/User.GridX + .5)*User.GridX

PinY =INT(SETATREFEXPR()/User.GridY + .5)*User.GridY

Example 3

For an example using the SETATREFEXPR function with the SETATREF function, see the SETATREF function.