Record Events

SPLASH directly creates record events, which are records with an associated operation like "insert". This documentation uses the term "record" interchangeably with "record event".

Record Event Details

The syntax of record types specifies the names and types of fields, and the key structure.
[ integer key1; string key2; | string dataField; ]
          
For instance, the above type describes records with key fields key1 and key2, of types integer and string respectively, and the non-key field dataField of type string. The key fields appear before the "|" symbol.
The syntax of record values mirrors that of record types. Here is a record with the previous type:
[ key1 = 9; key2 = 'USD'; | string data = 'US Currency'; ]
          
The syntax of record values is fairly flexible. You can write the same record as
[ key1 = 9; key2 = 'USD' | string data = 'US Currency' ]
[ key1 = 9; key2 = 'USD' | string data = 'US Currency'; ]
          
eliminating any semi-colon but those between field = value.
The operation of a new record value is insert. To change it, use the setOpcode function, as in
setOpcode([ key1 = 9 | string data = 'US Currency' ], update)
          
Records with more fields can be used in a context expecting fewer fields; the extra fields get coerced away. Conversely, records with fewer fields can be used in a context expecting more fields; the missing fields are assumed to be null. For instance, if var is a variable of type
[ integer key1; | string dataField; float otherData]
          
you can set
var := [key1 = 1; dataField = 'newdata'];
          
The record value is implicitly cast to the right type, making key1 the key field and setting the otherData field to null.

Operations on records: