packet (script)

5reg

packet (script)

A script packet

Content Model
    packet ::= (&xml-var;*, &xml-line;*, &xml-text;
                &xml-tag;*, &xml-packet;*)
Attributes
See the general &xml-packet; element documentation.

## Description

A script packet stores a &python; script offering direct low-level access to the ®ina; calculation engine.

A script may contain variables representing other packets in the same packet tree; these are described by the child &xml-var; elements.

The &python; script itself is stored as a single &xml-text; element. In older versions of ®ina; (4.95 and earlier) it was stored line-by-line using a sequence of &xml-line; elements, but this method of storage was deprecated when the &xml-text; element was introduced in ®ina; 4.96.

If you are writing a file that must be read by older versions of ®ina; then you may write the script twice, first as a series of &xml-line; elements (for ®ina; 4.95 and earlier), and then as a single &xml-text; element (for ®ina; 4.96 and later).

If you are writing both &xml-line; and &xml-text; elements, then the order is important.. This is because when ®ina; reads a &xml-line; element it will append the line to the script, but when it reads a &xml-text; element it will simply replace the entire script. Therefore, if the &xml-line; elements appear after the &xml-text; element, ®ina; will construct two copies of the script end-on-end.

The roles played by the child &xml-tag; and &xml-packet; elements are described in the general &xml-packet; element documentation.

### Parents

The following elements contain `packet`:

- &xml-packet;
- &xml-reginadata;

.

### Children

The following elements occur in `packet` for a script packet:

- &xml-line;
- &xml-packet;
- &xml-tag;
- &xml-text;
- &xml-var;

.