Index-label dot syntax

New to Analytica 7.0

I . "label"

This syntax consists of the identifier of an index, a dot, and a text literal (which can use single or double quotes).

Use this when your index (I) is a list-of-text index, and "label" is one of the index elements, and you express that this text literal needs to be the same as the index label.

The result of evaluating this construct is just "label". The association with the index does not impact equality -- i.e., even if two indexes, I and J are totally separate but both happen to have an element "label", it is still the case that I . "label" = J . "label" is True.

The syntax provides two advantages:

  1. It tells Analytica that the text literal is the value in the index. If you later change the label in the index. Analytica will automatically rewrite this expression, replacing it with the new value. Hence, it helps avoid logical errors that can creep into a large model if you forget to update some expressions after changing an index label.
  2. During evaluation, it double checks that "label" is indeed an element of the index. If not, it issues an evaluation-time warning. If you ignore the warning, the value is "label".

See also

Comments


You are not allowed to post comments.