Skip to content

Templature Data Types

Rebecca G. Bettencourt edited this page Dec 25, 2025 · 11 revisions

Decimal Fixed-Length Integer Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
DNIB BIND [d]nib[be|le] decimal nibble
DBYT TYBD [d]byte[be|le] decimal byte
DWRD DRWD [d]short[be|le] decimal integer, 16-bit
DLNG GNLD [d]int[be|le] decimal integer, 32-bit
DLLG GLLD [d]long[be|le] decimal integer, 64-bit
DImn nmID [d]intmn[be|le] decimal integer, mn-bit
DSmn nmSD [d]sintmn[be|le] decimal integer, signed
DUmn nmUD [d]uintmn[be|le] decimal integer, unsigned

Decimal values are signed by default, but may be specified as unsigned using the DUmn type constant or duintmn type keyword.

Hexadecimal Fixed-Length Integer Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
HNIB BINH hnib[be|le] hexadecimal nibble
HBYT TYBH hbyte[be|le] hexadecimal byte
HWRD DRWH hshort[be|le] hexadecimal integer, 16-bit
HLNG GNLH hint[be|le] hexadecimal integer, 32-bit
HLLG GLLH hlong[be|le] hexadecimal integer, 64-bit
HImn nmIH hintmn[be|le] hexadecimal integer, mn-bit
HSmn nmSH hsintmn[be|le] hexadecimal integer, signed
HUmn nmUH huintmn[be|le] hexadecimal integer, unsigned

Hexadecimal values are unsigned by default, but may be specified as signed using the HSmn type constant or hsintmn type keyword.

Octal Fixed-Length Integer Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
ONIB BINO onib[be|le] octal nibble
OBYT TYBO obyte[be|le] octal byte
OWRD DRWO oshort[be|le] octal integer, 16-bit
OLNG GNLO oint[be|le] octal integer, 32-bit
OLLG GLLO olong[be|le] octal integer, 64-bit
OImn nmIO ointmn[be|le] octal integer, mn-bit
OSmn nmSO osintmn[be|le] octal integer, signed
OUmn nmUO ouintmn[be|le] octal integer, unsigned

Octal values are unsigned by default, but may be specified as signed using the OSmn type constant or osintmn type keyword.

Binary Fixed-Length Integer Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
BNIB BINB bnib[be|le] binary nibble
BBYT TYBB bbyte[be|le] binary byte
BWRD DRWB bshort[be|le] binary integer, 16-bit
BLNG GNLB bint[be|le] binary integer, 32-bit
BLLG GLLB blong[be|le] binary integer, 64-bit
BImn nmIB bintmn[be|le] binary integer, mn-bit
BSmn nmSB bsintmn[be|le] binary integer, signed
BUmn nmUB buintmn[be|le] binary integer, unsigned

Binary values are unsigned by default, but may be specified as signed using the BSmn type constant or bsintmn type keyword.

Alignment Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
ANIB BINA anib[be|le] align to nibble boundary
ABYT TYBA abyte[be|le] align to byte boundary
AWRD DRWA ashort[be|le] align to word boundary, 16-bit
ALNG GNLA aint[be|le] align to word boundary, 32-bit
ALLG GLLA along[be|le] align to word boundary, 64-bit
ALmn nmLA alignmn[be|le] align to word boundary, mn-bit

Alignment fields are not visible in the editor. Bits or bytes inserted for alignment are filled with zeroes.

Filler Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
FBIT TIBF fbit[be|le] filler bit
FNIB BINF fnib[be|le] filler nibble
FBYT TYBF fbyte[be|le] filler byte
FWRD DRWF fshort[be|le] filler word, 16-bit
FLNG GNLF fint[be|le] filler word, 32-bit
FLLG GLLF flong[be|le] filler word, 64-bit
FLmn nmLF fillmn[be|le] filler word, mn-bit

Filler fields are not visible in the editor. Filler bits or bytes are filled with zeroes.

Boolean Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
BBIT TIBB bbit[be|le] boolean bit
BOOL LOOB bool[be|le] boolean word, 16-bit, true=$0100
BLmn nmLB boolmn[be|le] boolean word, mn-bit, true=+1
BNmn nmNB fboolmn[be|le] boolean word, mn-bit, true=-1

Fixed-Point Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
FXmn nmXF fixedmn[be|le] decimal fixed-point number

Fixed-point types use half of the bit width for the integer part and half of the bit width for the fractional part.

Floating-Point Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
MFLT TLFM mfloat[be|le] micro float (s1.e2.m1)
NFLT TLFN nfloat[be|le] NVidia float (s1.e5.m2)
HFLT TLFH hfloat[be|le] half float (s1.e5.m10)
BFLT TLFB bfloat[be|le] bfloat (s1.e8.m7)
TFLT TLFT tfloat[be|le] TensorFloat (s1.e8.m10)
AFLT TLFA afloat[be|le] ATI float (s1.e7.m16)
PFLT TLFP pfloat[be|le] PXR float (s1.e8.m15)
SFLT TLFS sfloat[be|le] single float (s1.e8.m23)
DFLT TLFD dfloat[be|le] double float (s1.e11.m52)
QFLT TLFQ qfloat[be|le] quadruple float (s1.e15.m112)
OFLT TLFO ofloat[be|le] octuple float (s1.e19.m236)
FPmn nmPF floatmn[be|le] custom float (see table below)

All floating-point formats follow IEEE 754 semantics.

The following additional formats are available using the FPmn type:

Bit Width Sign Exponent Mantissa
3 1 1 1
4 1 2 1
5 1 2 2
6 1 3 2
7 1 3 3
8 1 4 3
10 1 4 5
12 1 5 6
14 1 5 8
16 1 5 10
20 1 6 13
24 1 7 16
28 1 8 19
32 1 8 23
40 1 9 30
48 1 10 37
56 1 11 44
64 1 11 52
80 1 12 67
96 1 13 82

Variable-Length Numeric Types

Type Const (BE) Type Const (LE) Type Keyword Description Packable
DIVL LVID [d](be|le)b128 decimal variable-length integer
DSVL LVSD [d]s(be|le)b128 decimal variable-length integer, signed
DUVL LVUD [d]u(be|le)b128 decimal variable-length integer, unsigned
HIVL LVIH h(be|le)b128 hex variable-length integer
HSVL LVSH hs(be|le)b128 hex variable-length integer, signed
HUVL LVUH hu(be|le)b128 hex variable-length integer, unsigned
OIVL LVIO o(be|le)b128 octal variable-length integer
OSVL LVSO os(be|le)b128 octal variable-length integer, signed
OUVL LVUO ou(be|le)b128 octal variable-length integer, unsigned
BIVL LVIB b(be|le)b128 binary variable-length integer
BSVL LVSB bs(be|le)b128 binary variable-length integer, signed
BUVL LVUB bu(be|le)b128 binary variable-length integer, unsigned
VLPD DPLV vlpd[be|le] variable-length packed decimal, unsigned
VLFP PFLV vlfp[be|le] variable-length floating point

Big-endian variable-length integers look like:

1saaaaaa 1bbbbbbb ... 1yyyyyyy 0zzzzzzz = saaaaaabbbbbbb...yyyyyyyzzzzzzz

Little-endian variable-length integers look like:

1zzzzzzz 1yyyyyyy ... 1bbbbbbb 0saaaaaa = saaaaaabbbbbbb...yyyyyyyzzzzzzz

Where s is the sign (for signed integers) or the largest place value (for unsigned integers).

Variable-length packed decimal integers encode two decimal digits per byte:

Bit Pattern Description Tens Digit Ones Digit
abc0def two small digits 0abc 0def
abc100f one small digit, one large digit 0abc 100f
dec101f one large digit, one small digit 100c 0def
10c111f two large digits 100c 100f

Variable-length floating point numbers start with a single header byte which encodes the sign of the mantissa, the base (binary or decimal), the sign of the exponent, and the integer part of the mantissa:

Bit Pattern Base Description Value
s000abc0 binary small leading digit, zero exponent, no fraction (-1)s · 0abc.0
s000abc1 binary small leading digit, zero exponent, fraction (-1)s · 0abc.m
s001abc0 binary small leading digit, positive exponent, no fraction (-1)s · 0abc.0 · 2+n
s001abc1 binary small leading digit, positive exponent, fraction (-1)s · 0abc.m · 2+n
s010abc0 binary small leading digit, negative exponent, no fraction (-1)s · 0abc.0 · 2-n
s010abc1 binary small leading digit, negative exponent, fraction (-1)s · 0abc.m · 2-n
s01100c0 binary large leading digit, zero exponent, no fraction (-1)s · 100c.0
s01100c1 binary large leading digit, zero exponent, fraction (-1)s · 100c.m
s01101c0 binary large leading digit, positive exponent, no fraction (-1)s · 100c.0 · 2+n
s01101c1 binary large leading digit, positive exponent, fraction (-1)s · 100c.m · 2+n
s01110c0 binary large leading digit, negative exponent, no fraction (-1)s · 100c.0 · 2-n
s01110c1 binary large leading digit, negative exponent, fraction (-1)s · 100c.m · 2-n
s0111100 binary NaN, infinity, no payload (-1)s · ∞
s0111101 binary NaN, quiet, with payload quiet NaN
s0111110 binary NaN, canonical, no payload canonical NaN
s0111111 binary NaN, signaling, with payload signaling NaN
s100abc0 decimal small leading digit, zero exponent, no fraction (-1)s · 0abc.0
s100abc1 decimal small leading digit, zero exponent, fraction (-1)s · 0abc.m
s101abc0 decimal small leading digit, positive exponent, no fraction (-1)s · 0abc.0 · 10+n
s101abc1 decimal small leading digit, positive exponent, fraction (-1)s · 0abc.m · 10+n
s110abc0 decimal small leading digit, negative exponent, no fraction (-1)s · 0abc.0 · 10-n
s110abc1 decimal small leading digit, negative exponent, fraction (-1)s · 0abc.m · 10-n
s11100c0 decimal large leading digit, zero exponent, no fraction (-1)s · 100c.0
s11100c1 decimal large leading digit, zero exponent, fraction (-1)s · 100c.m
s11101c0 decimal large leading digit, positive exponent, no fraction (-1)s · 100c.0 · 10+n
s11101c1 decimal large leading digit, positive exponent, fraction (-1)s · 100c.m · 10+n
s11110c0 decimal large leading digit, negative exponent, no fraction (-1)s · 100c.0 · 10-n
s11110c1 decimal large leading digit, negative exponent, fraction (-1)s · 100c.m · 10-n
s1111100 decimal NaN, infinity, no payload (-1)s · ∞
s1111101 decimal NaN, quiet, with payload quiet NaN
s1111110 decimal NaN, canonical, no payload canonical NaN
s1111111 decimal NaN, signaling, with payload signaling NaN

If the value has an exponent, the header byte is followed by the exponent n as an unsigned variable-length integer.

If the least significant bit is set, the header byte and exponent (if present) are followed by the fractional part of the mantissa m (or the payload of a quiet or signaling NaN) as an unsigned variable-length integer (for binary values) or as an unsigned variable-length packed decimal integer (for decimal values).

Enum Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
EBIT TIBE ebit[be|le] enum bit
ENIB BINE enib[be|le] enum nibble
EBYT TYBE ebyte[be|le] enum byte
EWRD DRWE eshort[be|le] enum word, 16-bit
ELNG GNLE eint[be|le] enum word, 32-bit
ELLG GLLE elong[be|le] enum word, 64-bit
ENmn nmNE enummn[be|le] enum word, mn-bit
ENMV VMNE - enum value
ENME EMNE - enum end

In binary form, an enum field must be followed by one or more enum value fields and an enum end field, e.g.:

06 53 65 61 73 6F 6E              "Season"      45 42 59 54  'EBYT'
0A 31 20 2D 20 57 69 6E 74 65 72  "1 - Winter"  45 4E 4D 56  'ENMV'
0A 32 20 2D 20 53 70 72 69 6E 67  "2 - Spring"  45 4E 4D 56  'ENMV'
0A 33 20 2D 20 53 75 6D 6D 65 72  "3 - Summer"  45 4E 4D 56  'ENMV'
0A 34 20 2D 20 41 75 74 75 6D 6E  "4 - Autumn"  45 4E 4D 56  'ENMV'
05 2A 2A 2A 2A 2A                 "*****"       45 4E 4D 45  'ENME'

In text form, enum values are given after the type and name in curly braces, e.g.:

ebytebe Season {
    `1 - Winter`,
    `2 - Spring`,
    `3 - Summer`,
    `4 - Autumn`,
} `*****`;

Enum values are assigned numeric values given at the start or end of the value string or inside brackets within the value string. If no such numeric value is found within the value string, the next highest value is used. The following examples are equivalent to the above example:

ebytebe Season {
    `Winter = 1`,
    `Spring = 2`,
    `Summer = 3`,
    `Autumn = 4`,
} `*****`;

ebytebe Season {
    `(1) Winter`,
    `(2) Spring`,
    `(3) Summer`,
    `(4) Autumn`,
} `*****`;

ebytebe Season {
    `Winter [1]`,
    `Spring [2]`,
    `Summer [3]`,
    `Autumn [4]`,
} `*****`;

ebytebe Season {
    `{1} Winter`,
    `{2} Spring`,
    `{3} Summer`,
    `{4} Autumn`,
} `*****`;

ebytebe Season {
    `Winter;1`,
    `Spring`,
    `Summer`,
    `Autumn`,
} `*****`;

Character Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
CHAR RAHC char[be|le] one byte of characters
WCHR RHCW wchar[be|le] two bytes of characters
TNAM MANT tname[be|le] four bytes of characters (FCC)
SYMB BMYS symbol[be|le] eight bytes of characters (ECC)
UCHR RHCU uchar[be|le] UCS-2 character; UTF-16 codeunit
LCHR RHCL lchar[be|le] UCS-4 character; UTF-32 codeunit
CHmn nmHC charmn[be|le] (mn/8) bytes of characters

Character types (except for UCHR and LCHR) use the template's current text encoding, which defaults to MacRoman. This can be changed with a CSET or charset field.

String Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
PSTR RTSP pstring[be|le] Pascal string, 8-bit length
ESTR RTSE epstring[be|le] Pascal string, even length
OSTR RTSO opstring[be|le] Pascal string, odd length
Pxyz zyxP pstringlmn[be|le] Pascal string, fixed length
WSTR RTSW wstring[be|le] Pascal string, 16-bit length
EWST TSWE ewstring[be|le] Pascal string, even length
OWST TSWO owstring[be|le] Pascal string, odd length
Wxyz zyxW wstringlmn[be|le] Pascal string, fixed length
MSTR RTSM mstring[be|le] Pascal string, 24-bit length
EMST TSME emstring[be|le] Pascal string, even length
OMST TSMO omstring[be|le] Pascal string, odd length
Mxyz zyxM mstringlmn[be|le] Pascal string, fixed length
LSTR RTSL lstring[be|le] Pascal string, 32-bit length
ELST TSLE elstring[be|le] Pascal string, even length
OLST TSLO olstring[be|le] Pascal string, odd length
Lxyz zyxL lstringlmn[be|le] Pascal string, fixed length
CSTR RTSC cstring[be|le] C string (null-terminated)
ECST TSCE ecstring[be|le] C string, even length
OCST TSCO ocstring[be|le] C string, odd length
Cxyz zyxC cstringlmn[be|le] C string, fixed length
Nxyz zyxN nstringlmn[be|le] null-padded fixed-length string
Sxyz zyxS sstringlmn[be|le] space-padded fixed-length string
TEXT TXET text[be|le] unterminated string

String types use the template's current text encoding, which defaults to MacRoman. This can be changed with a CSET or charset field.

Line endings are converted to and from the template's current line ending, which defaults to carriage return. This can be changed with a LINE or newline field.

Fixed lengths in type constants are given in uppercase hexadecimal and in type keywords are given in decimal. They do not include the length of a Pascal string but do include the null terminator of a C string.

The Cxyz and zyxC type constants conflict when z is C. In this case the big-endian interpretation is used. It is recommended to only use the big-endian version of this type. (Endianness does not affect C strings.)

A TEXT field consumes all remaining data and can only occur at the end of the template.

Hex Dump Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
Hxyz zyxH hexlmn[be|le] binary data, fixed length
HEXD DXEH hexdump[be|le] binary data, unlimited length

Fixed lengths in type constants are given in uppercase hexadecimal and in type keywords are given in decimal.

A HEXD field consumes all remaining data and can only occur at the end of the template.

Geometry Types

Type Constant Type Keyword Description Encoding (UC=MSB, LC=LSB) Packable
PT2D point2Dbe QuickDraw point YY yy XX xx
PT3D point3Dbe 3D point ZZ zz YY yy XX xx
RECT rectbe QuickDraw rectangle TT tt LL ll BB bb RR rr
D2TP point2Dle QuickDraw point, reversed endianness xx XX yy YY
D3TP point3Dle 3D point, reversed endianness xx XX yy YY zz ZZ
TCER rectle QuickDraw rectangle, reversed endianness rr RR bb BB ll LL tt TT

Color Types

Type Constant Type Keyword Description Encoding Packable
RGB4 rgb444be RGB color, 12-bit (4 bits per channel) xxxxrrrr ggggbbbb
4BGR rgb444le RGB color, 12-bit (4 bits per channel) ggggbbbb xxxxrrrr
BGR4 bgr444be RGB color, 12-bit (4 bits per channel) xxxxbbbb ggggrrrr
4RGB bgr444be RGB color, 12-bit (4 bits per channel) ggggrrrr xxxxbbbb
RGB5 rgb555be RGB color, 15-bit (5 bits per channel) xrrrrrgg gggbbbbb
5BGR rgb555le RGB color, 15-bit (5 bits per channel) gggbbbbb xrrrrrgg
BGR5 bgr555be RGB color, 15-bit (5 bits per channel) xbbbbbgg gggrrrrr
5RGB bgr555le RGB color, 15-bit (5 bits per channel) gggrrrrr xbbbbbgg
RGB6 rgb565be RGB color, 16-bit (5-6-5) rrrrrggg gggbbbbb
6BGR rgb565le RGB color, 16-bit (5-6-5) gggbbbbb rrrrrggg
BGR6 bgr565be RGB color, 16-bit (5-6-5) bbbbbggg gggrrrrr
6RGB bgr565le RGB color, 16-bit (5-6-5) gggrrrrr bbbbbggg
RGBC rgb888be RGB color, 24-bit (8 bits per channel) rr gg bb
CBGR rgb888le RGB color, 24-bit (8 bits per channel) bb gg rr
BGRC bgr888be RGB color, 24-bit (8 bits per channel) bb gg rr
CRGB bgr888le RGB color, 24-bit (8 bits per channel) rr gg bb
XRGB xrgb8888be RGB color, 32-bit with padding xx rr gg bb
BGRX xrgb8888le RGB color, 32-bit with padding bb gg rr xx
XBGR xbgr8888be RGB color, 32-bit with padding xx bb gg rr
RGBX xbgr8888le RGB color, 32-bit with padding rr gg bb xx
ARGB argb8888be RGB color, 32-bit with alpha aa rr gg bb
BGRA argb8888le RGB color, 32-bit with alpha bb gg rr aa
ABGR abgr8888be RGB color, 32-bit with alpha aa bb gg rr
RGBA abgr8888le RGB color, 32-bit with alpha rr gg bb aa
RGBc rgb161616be RGB color, 48-bit (16 bits per channel) RR rr GG gg BB bb
cBGR rgb161616le RGB color, 48-bit (16 bits per channel) bb BB gg GG rr RR
BGRc bgr161616be RGB color, 48-bit (16 bits per channel) BB bb GG gg RR rr
cRGB bgr161616le RGB color, 48-bit (16 bits per channel) rr RR gg GG bb BB

List Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
ZCNT TNCZ zcount[be|le] list count, 16-bit, zero-based
ZCmn nmCZ zcountmn[be|le] list count, mn-bit, zero-based
OCNT TNCO ocount[be|le] list count, 16-bit, one-based
OCmn nmCO ocountmn[be|le] list count, mn-bit, one-based
LSTC CTSL listc[be|le] counted list
LSTZ ZTSL listz[be|le] null-terminated list
LSTB BTSL list[be|le] unterminated list
LSTE ETSL - list end

A "zero-based" list count actually starts at -1 for an empty list. A "one-based" list count starts at 0 for an empty list.

A list count field must be followed by a counted list field. A counted list field must be preceded by a list count field.

In binary form, a list field must be followed by one or more data fields and a list end field, e.g.:

05 43 6F 75 6E 74     "Count"   4F 43 4E 54  'OCNT'
05 2A 2A 2A 2A 2A     "*****"   4C 53 54 43  'LSTC'
06 41 20 42 79 74 65  "A Byte"  48 42 59 54  'HBYT'
05 2A 2A 2A 2A 2A     "*****"   4C 53 54 45  'LSTE'

05 2A 2A 2A 2A 2A     "*****"   4C 53 54 5A  'LSTZ'
06 41 20 42 79 74 65  "A Byte"  48 42 59 54  'HBYT'
05 2A 2A 2A 2A 2A     "*****"   4C 53 54 45  'LSTE'

05 2A 2A 2A 2A 2A     "*****"   4C 53 54 42  'LSTB'
06 41 20 42 79 74 65  "A Byte"  48 42 59 54  'HBYT'
05 2A 2A 2A 2A 2A     "*****"   4C 53 54 45  'LSTE'

In text form, data fields are given after the type and name in curly braces, e.g.:

ocountbe Count;
listc `*****` {
    hbytebe `A Byte`;
} `*****`;

listz `*****` {
    hbytebe `A Byte`;
} `*****`;

list `*****` {
    hbytebe `A Byte`;
} `*****`;

A LSTB list consumes all remaining data and can only occur at the end of the template.

Packed Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
PCKB BKCP packed[be|le] packed data structure begin
PCKE EKCP - packed data structure end

In binary form, a PCKB field must be followed by one or more packable data fields and a PCKE field, e.g.:

05 2A 2A 2A 2A 2A  "*****"  50 43 4B 42  'PCKB'
04 48 69 67 68     "High"   48 4E 49 42  'HNIB'
03 4C 6F 77        "Low"    48 4E 49 42  'HNIB'
05 2A 2A 2A 2A 2A  "*****"  50 43 4B 45  'PCKE'

In text form, data fields are given after the type and name in curly braces, e.g.:

packedbe `*****` {
    hnibbe High;
    hnibbe Low;
} `*****`;

Data fields within a packed data structure must have the same endianness as the structure itself.

Conditional Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
CONB BNOC if Condition begin ("if")
CONC CNOC elif Condition continue ("else if")
COND DNOC else Condition default ("else")
CONE ENOC - Condition end
CASB or SELB BSAC or BLES switch Switch begin
CASC or SELC CSAC or CLES case Switch case
CASD or SELD DSAC or DLES default Switch default
CASE or SELE ESAC or ELES - Switch end

For "begin" and "continue" fields, the label is an expression used to determine if the case applies. For "default" and "end" fields, the label is ignored.

In binary form, conditional blocks look like:

09 54 68 65 20 56 61 6C 75 65                    "The Value"        44 42 59 54  'DBYT'
0F 60 54 68 65 20 56 61 6C 75 65 60 20 3D 20 31  "`The Value` = 1"  43 4F 4E 42  'CONB'
08 48 65 78 20 42 79 74 65                       "Hex Byte"         48 42 59 54  'HBYT'
0F 60 54 68 65 20 56 61 6C 75 65 60 20 3D 20 32  "`The Value` = 2"  43 4F 4E 43  'CONC'
0A 4F 63 74 61 6C 20 42 79 74 65                 "Octal Byte"       4F 42 59 54  'OBYT'
05 2A 2A 2A 2A 2A                                "*****"            43 4F 4E 44  'COND'
0B 42 69 6E 61 72 79 20 42 79 74 65              "Binary Byte"      42 42 59 54  'BBYT'
05 2A 2A 2A 2A 2A                                "*****"            43 4F 4E 45  'CONE'

09 54 68 65 20 56 61 6C 75 65                    "The Value"        44 42 59 54  'DBYT'
0B 60 54 68 65 20 56 61 6C 75 65 60              "`The Value`"      53 45 4C 42  'SELB'
01 31                                            "1"                53 45 4C 43  'SELC'
08 48 65 78 20 42 79 74 65                       "Hex Byte"         48 42 59 54  'HBYT'
01 32                                            "2"                53 45 4C 43  'SELC'
0A 4F 63 74 61 6C 20 42 79 74 65                 "Octal Byte"       4F 42 59 54  'OBYT'
05 2A 2A 2A 2A 2A                                "*****"            53 45 4C 44  'SELD'
0B 42 69 6E 61 72 79 20 42 79 74 65              "Binary Byte"      42 42 59 54  'BBYT'
05 2A 2A 2A 2A 2A                                "*****"            53 45 4C 45  'SELE'

In text form, conditional blocks look like:

bytebe `The Value`;
if (`The Value` = 1) {
    hbytebe `Hex Byte`;
} elif (`The Value` = 2) {
    obytebe `Octal Byte`;
} else `*****` {
    bbytebe `Binary Byte`;
} `*****`;

bytebe `The Value`;
switch (`The Value`) {
    case 1:
        hbytebe `Hex Byte`;
    case 2:
        obytebe `Octal Byte`;
    default `*****`:
        bbytebe `Binary Byte`;
} `*****`;

Cases in a switch block do not fall through.

Static Element Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
HDG1 1GDH h1 Heading 1
HDG2 2GDH h2 Heading 2
HDG3 3GDH h3 Heading 3
HDG4 4GDH h4 Heading 4
HDG5 5GDH h5 Heading 5
HDG6 6GDH h6 Heading 6
PARA ARAP p Paragraph
SEPA APES hr Horizontal rule

These field types add informational content to the editor but do not affect the data stream.

Metadata Types

Type Constant (BE) Type Constant (LE) Type Keyword Description Packable
COMM MMOC rem Comment
META ATEM meta Metadata
CSET TESC charset Set text encoding
LINE ENIL newline Set line ending
- - endianness Set default endianness

Comment and metadata fields are ignored.

Text encoding fields are used to set the text encoding of character and string data fields. The default is MacRoman.

Line ending fields are used to set the line ending of string data fields. The default is carriage return. Possible values are:

Identifier Line Ending
crlf U+000D+000A
cr U+000D
lf U+000A
nl U+0085
nel U+0085
lsep U+2028
psep U+2029

Endianness fields apply only to templates in text form. They set the endianness of data fields for which endianness is not specified. The default is big-endian. The endianness keyword must be followed by a be, le, big, or little keyword.

It is generally recommended to set the text encoding, line ending, and endianness at the beginning of any new templates you create.

In binary form:

0C 57 69 6E 64 6F 77 73 2D 31 32 35 32  "Windows-1252"  43 53 45 54  'CSET'
04 43 52 4C 46                          "CRLF"          4C 49 4E 45  'LINE'

In text form:

charset "Windows-1252";
newline crlf;
endianness little;