Skip to main content
For the full syntax and function catalog, use the original Script reference. Function availability depends on the execution context. The loaded runtime determines which Script functions exist. The Neuron also checks whether an expression is allowed in its contract or state-machine context. Local evaluation is not proof of permission to execute on a server.

Find a function by task

Use the original reference for additional signatures. Check that the chosen function is available in the contract or machine context where you will run it.

Numeric functions used in these examples

The following scalar cases were evaluated with Waher.Script 2.15.0. They require no context variables and have no external side effects. These functions also implement complex scalar cases in the selected source. The table’s tested examples cover real numbers. Confirm the supported type for the receiving contract parameter. Unsupported input types can fail evaluation. Round is not a complete monetary-rounding policy. A payment workflow must define its units, precision, and rounding rules explicitly. Use the tested function reference for numeric conversion, strings, collections, bounds, and rounding. It links each signature to an executable example and its expected value.

Expressions in a contract

A parameter’s validation expression uses the values exposed by the contract context. Calculated parameters derive values from those inputs. See contract parameters and the CalculatedParameters example. The selected contract parser populates named parameters and Duration before validation. When a first signature exists, it also supplies Now and NowUtc from that signature’s timestamp. These are not an instruction to read the current wall clock. Avoid assuming they exist in an unsigned template. Keep validation deterministic. A function that reads external mutable data can make the result depend on when or where evaluation occurs.

Expressions in a state machine

Event data exists only when the selected event defines it. For example, a note event can assign the note to a variable named by its noteVariable setting. Initialize every variable your expression reads, and avoid colliding with event variable names. The selected machine implementation creates evaluation variables from saved values and supplies a CurrentState host object. Treat that object as host context, not as a portable API response schema. The complete example uses its own Count variable and does not depend on host-object members or note-data variables.

Persist a value

Ordinary assignment changes the evaluation variables. To retain a value across machine actions, use PersistVariable:
This fragment requires an initialized numeric Count. Verify the new value and recorded history after triggering the complete machine.

Optional functions and restrictions

Functions such as XML selection, content conversion, networking, and provider-specific operations can require extra assemblies or services. Do not infer their signatures or availability from an administrative prompt or a different example. Record the exact package and permitted execution context before using them. The LegalLab catalog lists examples that may use such functions. Those examples need their own compatibility checks. The Script quickstart explains core expressions and their expected results; the Agent API workflow handles contract submission and inspection.