packet (script)

5reg

packet (script)

Replaced by &xml-script;

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

&eltdepver;7.0

## Description

In ®ina; 6.0.1 and earlier, the &xml-packet; element was used to store every packet in the entire packet tree that makes up a ®ina; data file. This page describes how the &xml-packet; element was structured when storing a script packet. Since ®ina; 7.0, each packet type has its own &xml; element; in particular, script packets are now stored using the &xml-script; element.

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 way the &python; code is stored has changed over time:

- Between ®ina; 4.96 and ®ina; 6.0.1, the &python; code was stored as a single &xml-text; element.

- In ®ina; 4.95 and earlier, the &python; code was stored line-by-line using a sequence of &xml-line; elements.

Both storage methods are still recognised by ®ina; when reading old second-generation data files.

If you are writing a second-generation data file that must be read by very old versions of ®ina; (dating back to ®ina; 4.95), then you may write the script twice: first as a series of &xml-line; elements, and then again as a single &xml-text; element. However, the &xml-line; elements must come first, since when ®ina; reads a file it will append each &xml-line; to the script, whereas if it sees a &xml-text; element it will replace the script entirely. Therefore, if the &xml-line; elements appear after the &xml-text; element, ®ina; will effectively build 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-packet;
- &xml-tag;
- &xml-text;
- &xml-var;

.