Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter ElevenSGML Functions (continued)

XDXCreateCalculationComponent Function

Overview

The XDXCreateCalculationComponent function assembles a calculation component from a list or table.

Syntax/Parameters

Syntax

string = XDXCreateCalculationComponent ( string data[] );

string = XDXCreateCalculationComponent ( string data[][] );

Parameters

data

A string array as a list or table containing named parameters. See Remarks below.

Return Value

A string containing coded component or components for an engram or an empty string on failure. Use the GetLastError function to retrieve a formatted error code and GetLastErrorMessage for additional detail.

When using a table as an input, the lower byte of the last error code will contain the row with the offending data.

Remarks

Component parameters are provided as an array with named keys. The key names are either list elements or table columns. They are as follows:

  Definition   Description  
  relationship_code   A numeric version of the relationship. See below.  
  relationship_string   A string version of the relationship.  
  id   An identifier for the calculation that is 4 digits long. All engrams that use the same calculation identifier will be part of a single calculation. If an engram is used for a concept that is in more than one calculation another set of weight and identifier parameters are added.  

 

The relationship should be provided as either a code or a string. If both are provided, they must match in meaning. For example, XDX_ROW_CALC_ADD0” cannot be combined with “subtract”. If the relationship is omitted, it defaults to “add”.

If more than one calculation arc is added, then a table can be used row by row with the values placed in the named columns.

Note that the returned component does not contain an engram code. This is added when the component is added using the XDXPropertiesToEngram function.

The reciprocal function is XDXGetCalculationProperties.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic