Error Messages/43000

Example Error Message

Lexical error at line 1:
Choice(['US','Canada'], 1)
       ↑
The first parameter, «I», of Choice cannot be a list. It must be either an index identifier or the keyword Self. You probably want to set the Domain attribute to be an explicit list of values, and then use the keyword Self for the «I» parameter of Choice.

or you may see:

Expected an index for «I», the first parameter of Choice.

Description

A call to a function attempted to pass something other than an index to a parameter that expects and index. In the example above, a literal list was passed in where Choice expects an index identifier as its first parameter.

In the above case involving Choice, one resolution would be to set the Domain attribute to be ['US', 'Canada'] (i.e., a list of text), and then change the Definition to be Choice( Self, 1 ). That applies to a few functions that can use their own domain as the index.

More generally, the typical resolution is to create a new Index variable, e.g.,

Index Country ::= ['US', 'Canada']

And then change the Definition to Choice( Country, 1 ), where you pass the index identifier instead of the value.

Comments


You are not allowed to post comments.