Use this procedure to add a formula property definition to a property set definition. Formula property values can be computed based on the values of other property data. A formula property definition is a type of automatic property, because the value it displays is determined automatically, based on its definition, and cannot be edited directly.
Formulas can be simple mathematical expressions, such as 2+2. They can also contain variables, operators, and functions allowed in VBScript, as shown in the examples below.
Statements | |||
---|---|---|---|
Call Statement | For Each...Next Statement | Property Get Statement | Set Statement |
Class Statement | For...Next Statement | Property Let Statement | Sub Statement |
Const Statement | Function Statement | Property Set Statement | While...Wend Statement |
Dim Statement | If...Then...Else Statement | Public Statement | Set Statement |
Do...Loop Statement | On Error Statement | Randomize Statement | With Statement |
Erase Statement | Option Explicit Statement | ReDim Statement | |
Execute Statement | Private Statement | Select Case Statement |
Functions | |||
---|---|---|---|
Abs | Escape | LBound | ScriptEngineMinorVersion |
Array | Eval | LCase | Second |
Asc | Exp | Left | SetLocale |
Atn | Filter | Len | Sgn |
CBool | FormatCurrency | LoadPicture | Sin |
CByte | FormatDateTime | Log | Space |
CCur | FormatNumber | LTrim | Split |
CDate | FormatPercent | Maths | Sqr |
CDbl | GetLocale | Mid | StrComp |
Chr | GetObject | Minute | String |
CInt | GetRef | Month | Tan |
CLng | Hex | MonthName | Time |
Conversions | Hour | MsgBox | Timer |
Cos | InputBox | Now | TimeSerial |
CreateObject | InStr | Oct | TimeValue |
CSng | InStrRev | Replace | Trim |
Date | Int, Fix | RGB | TypeName |
DateAdd | IsArray | RTrim | UBound |
DateDiff | IsDate | Right | UCase |
DatePart | IsEmpty | Rnd | Unescape |
DateSerial | IsNull | Round | VarType |
DateValue | IsNumeric | ScriptEngine | Weekday |
Day | IsObject | ScriptEngineBuildVersion | WeekdayName |
Derived Math | Join | ScriptEngineMajorVersion | Year |
- Click
.
The Style Manager is displayed with the current drawing expanded in the tree view.
- Expand Documentation Objects
Property Set Definitions.
- Select the property set definition to change.
- On the Definition tab, click
.
- On the Formula Property Definition worksheet, enter a name for the formula property.
- If you do not want to use the formula as the description of the property, clear Use formula for description.
- Enter the formula:
If you want to… Then… use a value that you supply click in the Formula pane, and enter the value. use the value of another property definition in the formula locate and double-click (or right-click, and click Insert) the definition in the Insert Property Definitions list. You can also select the definition, and press Insert. use a VBScript function locate and double-click (or right-click, and click Insert) the function in the Insert VBScript code list. You can also select the function, and press Insert. evaluate the formula as a VBScript function enter RESULT anywhere in the formula. The property definitions available for use in the formula must be applied to the same objects as the property set definition containing the formula.
The names of property definitions used in the formula are displayed within brackets, such as [Width]. If a property definition belongs to a property set definition other than the one containing the formula, that name is displayed as well, such as [DoorObjects:Height].
The formula property definition cannot be used in the formula it defines, as indicated by the
and the addition of [Self] after its name. Property definitions that end up using the value of the formula cannot be used in the formula, as indicated by the
and the addition of [Circular Reference] after their names.
Note: If you enter the name of a property definition directly in the formula string, or copy and paste between formulas, the property definition is displayed as normal text. For property values of property definitions to be inserted correctly, they must be selected from the list in the Insert Property Definitions pane. - In the Enter Sample Values pane, enter a value.
The property value you enter displays with the current format specified in the Sample Result pane.
- In the Enter Sample Values pane, select a property data format.
The format you select effects how the data in the Value column displays in the Sample Result pane and how the formula evaluates in the in the schedule table. It can be changed at any time.
- Click OK twice.