Difference between revisions of "Expression Assist"

(EW20367 - AcpStyles attribute.)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:Analytica User Guide]]
 
[[Category:Analytica User Guide]]
 
[[Category: Expressions]]
 
[[Category: Expressions]]
<breadcrumbs>Analytica User Guide > Creating and Editing Definitions > {{PAGENAME}}</breadcrumbs>
+
<breadcrumbs>Analytica User Guide > Definitions > {{PAGENAME}}</breadcrumbs>
 +
{{ReleaseBar}}
  
 +
'''Expression Assist''' provides context-sensitive help as you type into a expression attribute ([[Definition]], [[Check attribute]], [[Domain]] (expression view), [[OnClick]], [[OnChange]], [[OnGraphDraw]], [[OnGraphClick]], [[Cell Format Expression]], [[Cell Default]], or [[Initial guess]]){{Release|6.0||&nbsp;or into the [[AcpStyles]] attribute}}. It saves keystrokes and reduces typos. After typing the first letter(s) of an identifier, it shows a list of the variables and functions that match those characters. You can select one using up or down arrows (or scroll wheel) and tab to complete the identifier. When entering the parameters of a function, it shows a description of the function, and lets you select a parameter. When entering a value for an index, it shows you a list of possible values.
  
'''Expression Assist''' provides context-sensitive help information as you type an expression. The information updates with each keystroke as you type, displaying function parameters and possible identifier or index label completions. Identifier completion can also save you keystrokes and reduce the risk of typos.
+
'''Enable or disable''': You can turn Expression Assist on or off in the [[Preferences dialog]].
  
'''Enabling or disabling''': Expression Assist is turned on or off from the '''Preference '''dialog.
+
Even when it's off, you can turn it on temporarily while typing into a Definition by pressing ''Ctrl+Space'' at the current typing point, or
 +
or ''Ctrl+Shift+?'' to toggle it on for just this Definition.
  
When the preference is off, you can still access the feature while typing an expression by pressing ''Ctrl+Space ''or ''Ctrl+Shift+?''. ''Ctrl+Space ''displays the help only once (but only if the Expression Assist has something to display at the current context of the caret), while ''Ctrl+Shift+? ''temporarily toggles the feature for the field being edited.
+
Occasionally the [[Expression Assist]] popup blocks something else that you wish to see. When that happens, press the ''Esc ''key to temporarily remove them. They will reappear when you start typing again.  You can also press ''Ctrl+Shift+? ''to toggle them off and on.
  
When the preference is on, it automatically appears as you are typing an expression into a [[Definition]] or [[Check attribute]], changing with each keystroke. Occasionally the '''Expression Assist''' popups will block something else on the screen that you wish to see. When this happens, press the ''Esc ''key to temporarily remove the popups. They will reappear was you start typing again. To remove them for a span of keystrokes, press ''Ctrl+Shift+? ''to toggle the pops off and on.
+
'''Identifier completion''': As you start to type an [[identifier]] it shows a list of identifiers that match the initial letters (or other characters).  For example, here the user has typed  “D” so it shows a list of identifiers starting with “D”:
 
 
'''Identifier completion''': As you begin to type an identifier, a listing of possible identifier completions appears.
 
  
 
:[[File:Chapter8 17.png]]
 
:[[File:Chapter8 17.png]]
  
In this example, the list of shows identifiers starting with “D”, the part of the identifier typed so far. At the top above the separator line appears inputs to the variable, for which arrows had been previously drawn. The '''Standard '''tab is selected, so that the more esoteric identifiers are not included. The '''Advanced '''tab includes object identifiers that are only relevant to advanced meta-programming topics, such as attribute and module names. The mouse wheel can be used to scroll the list. At this point, pressing the ''Tab ''key would insert the first item, <code>Depreciation</code>, into your definition. As you continue to type, the list of possible completions narrows:.
+
At the top, it lists any matching inputs to the variable, from which arrows had been previously drawn. Use the scroll wheel or up and down arrows to move through the list. Press the ''Tab ''key to insert the item, in this case <code>Depreciation</code>, into your definition. The mouse wheel can be used to scroll the list. At this point, pressing  As you continue to type, the list of possible completions narrows:
  
 
:[[File:Chapter8 18.png]]
 
:[[File:Chapter8 18.png]]
  
Clicking on an entry, or pressing the down-arrow to select the entry of interest and pressing ''Tab ''or ''Enter ''inserts the identifier into your expression.
+
Click an entry, or press the down-arrow to select an entry. Pressing ''Tab ''or ''Enter '' to insert the identifier into the definition.
  
'''Function parameter info''': When you are editing a parameter argument to a function, Expression Assist displays the list of parameter names and the function’s description.
+
'''Function parameter info''': When you are editing a [[Function calls and parameters|parameter]] argument to a function, Expression Assist displays the list of parameter names and the function’s description.
  
 
:[[File:Chapter8 19.png]]
 
:[[File:Chapter8 19.png]]
Line 28: Line 29:
 
The first line of the popup shows the parameters to the function being entered, with the current parameter being entered is shown in bold and optional parameters in italics. You can click on the parameter name to insert the parameter name with a colon into the definition for named parameter syntax.
 
The first line of the popup shows the parameters to the function being entered, with the current parameter being entered is shown in bold and optional parameters in italics. You can click on the parameter name to insert the parameter name with a colon into the definition for named parameter syntax.
  
'''Subscript help''': When entering a subscript or slice operation, <code>X[I = v]</code> or <code>X[@I = n]</code>, Expression Assist can in some cases provide a listing of the indexes of <code>X</code> when you are about to type the index name, <code>I</code>. When it can do this, the list of possible indexes appears immediately after you type the left bracket. '''Expression Assist''' will only provide the list of indexes when it can do so without initiating any evaluation, which means that <code>X</code> must be a single identifier (not a computed expression) and the value of <code>X</code> must have been previously evaluated and cached.
+
'''Subscript help''': When entering a [[subscript]] or [[slice]] operation, <code>X[I = v]</code> or <code>X[@I = n]</code>, after typing the open bracket <code>X[</code> it may list the indexes of <code>X</code> from which you can choose. It can only do this after it has evaluated  <code>X</code> and so knows what indexes it has.  
  
 
:[[File:Chapter8 20.png]]
 
:[[File:Chapter8 20.png]]
  
Similarly, when you get to the index value, <code>v</code>, '''Expression Assist''' can in many cases display the set of possible index labels as an autocompletion list. Again, suggested values are only displayed when it can do so without initiating evaluation. This is generally possible for indexes defined as lists, or for computed indexes that have been previously evaluated.
+
Similarly, when you are about to type in the value of an index, index value after you have typed, <code>X[I = </code>, it may show a list of the available index labels, with autocompletion. Again, it can only do this if it does not need to evaluate <code>I</code> -- e.g. for indexes defined as lists, or for computed indexes that have been previously evaluated.
  
 
:[[File:Chapter8 21.png]]
 
:[[File:Chapter8 21.png]]
  
Because these suggestions can be extremely helpful when typing definitions, you may find it useful to evaluate parent variables before you start typing the definition.
+
Because these suggestions can be extremely helpful, you may find it useful to evaluate input variables before you start typing the definition.
 +
 
 +
'''Standard and Advanced tabs''': With the '''Standard '''tab it excludes some more esoteric identifiers. Select the '''Advanced '''tab to include attribute and module names of relevance for [[Meta-Inference|meta-programming]] topics.
 +
 
 +
{{Release|6.0||'''List of applicable ACP Attributes''': When editing the [[AcpStyles]] attribute in the [[Object Window]], it auto-completes the list of attributes that are applicable within the object type being edited. You can press Ctrl+Space when at the start of the line to get the full list. Once you type a colon (<code>:</code>) after the attribute name, it auto-completes the list of possible values for that attribute.}}
 +
:[[Image:EA in AcpStyle attribute.png]]
  
 
==See Also==
 
==See Also==
* [[Creating_Models#Expression_Assist|Tutorial: Expression Assist]]
+
* [[Tutorial: Create a model#Expression_Assist|Tutorial: Expression Assist]]
 
* [[The Expression popup menu]]
 
* [[The Expression popup menu]]
 
* [[Expression Syntax]]
 
* [[Expression Syntax]]

Latest revision as of 21:06, 11 October 2021



Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3  •  6.4  •  6.5  •  6.6


Expression Assist provides context-sensitive help as you type into a expression attribute (Definition, Check attribute, Domain (expression view), OnClick, OnChange, OnGraphDraw, OnGraphClick, Cell Format Expression, Cell Default, or Initial guess) or into the AcpStyles attribute. It saves keystrokes and reduces typos. After typing the first letter(s) of an identifier, it shows a list of the variables and functions that match those characters. You can select one using up or down arrows (or scroll wheel) and tab to complete the identifier. When entering the parameters of a function, it shows a description of the function, and lets you select a parameter. When entering a value for an index, it shows you a list of possible values.

Enable or disable: You can turn Expression Assist on or off in the Preferences dialog.

Even when it's off, you can turn it on temporarily while typing into a Definition by pressing Ctrl+Space at the current typing point, or or Ctrl+Shift+? to toggle it on for just this Definition.

Occasionally the Expression Assist popup blocks something else that you wish to see. When that happens, press the Esc key to temporarily remove them. They will reappear when you start typing again. You can also press Ctrl+Shift+? to toggle them off and on.

Identifier completion: As you start to type an identifier it shows a list of identifiers that match the initial letters (or other characters). For example, here the user has typed “D” so it shows a list of identifiers starting with “D”:

Chapter8 17.png

At the top, it lists any matching inputs to the variable, from which arrows had been previously drawn. Use the scroll wheel or up and down arrows to move through the list. Press the Tab key to insert the item, in this case Depreciation, into your definition. The mouse wheel can be used to scroll the list. At this point, pressing As you continue to type, the list of possible completions narrows:

Chapter8 18.png

Click an entry, or press the down-arrow to select an entry. Pressing Tab or Enter to insert the identifier into the definition.

Function parameter info: When you are editing a parameter argument to a function, Expression Assist displays the list of parameter names and the function’s description.

Chapter8 19.png

The first line of the popup shows the parameters to the function being entered, with the current parameter being entered is shown in bold and optional parameters in italics. You can click on the parameter name to insert the parameter name with a colon into the definition for named parameter syntax.

Subscript help: When entering a subscript or slice operation, X[I = v] or X[@I = n], after typing the open bracket X[ it may list the indexes of X from which you can choose. It can only do this after it has evaluated X and so knows what indexes it has.

Chapter8 20.png

Similarly, when you are about to type in the value of an index, index value after you have typed, X[I = , it may show a list of the available index labels, with autocompletion. Again, it can only do this if it does not need to evaluate I -- e.g. for indexes defined as lists, or for computed indexes that have been previously evaluated.

Chapter8 21.png

Because these suggestions can be extremely helpful, you may find it useful to evaluate input variables before you start typing the definition.

Standard and Advanced tabs: With the Standard tab it excludes some more esoteric identifiers. Select the Advanced tab to include attribute and module names of relevance for meta-programming topics.

List of applicable ACP Attributes: When editing the AcpStyles attribute in the Object Window, it auto-completes the list of attributes that are applicable within the object type being edited. You can press Ctrl+Space when at the start of the line to get the full list. Once you type a colon (:) after the attribute name, it auto-completes the list of possible values for that attribute.

EA in AcpStyle attribute.png

See Also


Comments


You are not allowed to post comments.