Code mode: one script for the whole configurator — gull system handbook

Code mode (the Logic add-on) in gull system: a JavaScript script, inputs and return, unit settings, what a script may not do, limits and messages.

Code mode: one script for the whole configurator

With the Logic add-on one JavaScript script replaces the formulas: it reads the inputs and returns the parameter values. It suits a calculation with loops, arrays or more steps than fit in a formula.

Switch it on

In step 3, in the ribbon's Evaluation group click Code and confirm Change. The formulas stay saved and are simply not used; switching back works the same way.

The shape of a script

Settings

What a script may not do

Limits and messages

A script may run for 2 s, create arrays up to 10 million items and recurse only so deep; exceeding that stops the order with "an endless loop?". A script returning names no parameter has gets a warning in the editor already.

Suppression in a script follows the old convention: `true` or a non-zero number = suppress, the opposite of formulas. The texts `"S"` (suppress) and `"U"` (active) mean the same in both modes — use them so you never have to think about which mode you are in.

The preview in Code mode does not write to the model, unlike formulas. You see a script's result on an order or in the Parameters panel.