A CSPro logic object is a variable that is similar to the objects that exist in other programming languages that are "object-oriented." CSPro logic is not fully object-oriented, but some variables have functions (sometimes called "methods") that can be called by using both the variable name as well as the function name.
The following objects have functions that can be called on the object: array
, and valueset
. A list of available functions can be found in each of those summary pages.
One way to understand dot notation is to think of it as a shorthand way to specify what variable should be used when performing an operation. For example, here are two ways to work through the elements of a list:
Unlike other CSPro functions, the functions that are associated with an object will not show as blue and they are not reserved words.
Using a dot specifies that you are accessing a function or variable (property) of the object. For example, a value set object contains two internal variables, codes and labels, both of which are lists, that can be accessed as in:
list string province_labels = PROVINCE_VS.labels;
numeric selected_province = province_labels.show("Select a province");
This could also be written using multiple dots:
numeric selected_province = PROVINCE_VS.labels.show("Select a province");