UNIX Interface

• • • • • • • • • • • • • • • • • • • • • • • • • • •

UNIX Third-Party Interface

Introduction

The design of the WordPerfect third-party interface lets software developers write programs that interface directly with WordPerfect 5.1. This same application interface will eventually be available for all WordPerfect Corporation UNIX products.

There are two parts in the interface specification—detection and keyboard input. First, WordPerfect must be able to detect that another program wants to interface with WordPerfect. The other program monitors, and perhaps modifies, the keyboard input to WordPerfect. All keystrokes entered by the user are first passed to the other program. The other program can return the key unaltered, tell WordPerfect to delete the keystroke, or replace the key that the user entered with one or more different keystrokes.

All of the codes are documented in bytes. For example a short integer value (16-bit value) is defined as 2 bytes. This is because of the different versions of UNIX available. All 16-bit and larger tokens/parameters are in "Intel order." In this order the low byte of the value comes first, then the high byte comes second. Some versions of UNIX follow this order and some versions follow the reverse order. If your program needs to be transportable, you should write your program to handle 16-bit and greater values at the byte level, even if your system already supports the "Intel order."

Detection

There are two startup methods for third-party programs. The third-party program can be specified in an initialization file and started by the WordPerfect program, or the third-party program can start WordPerfect on demand. Both methods are explained below.

Before starting WordPerfect, the third-party program needs to use the pipe() system call function to create two pipes for passing messages back and forth with WordPerfect.

The third-party program then uses the fork() and exec() system calls to start WordPerfect. The pipe handles are given to WordPerfect as command line arguments. To accomplish this, add the following to the command line when starting WordPerfect:

-third xxxxx,yyyyy

Where xxxxx	=	the ASCII representation of the value of the pipe handle that WordPerfect uses to read messages from the third-party program.

yyyyy	=	the ASCII representation of the value of the pipe handle that WordPerfect uses to send messages to the third-party program.

If WordPerfect is not started with the -third option, it reads the wpthird.ini file to determine if third-party programs need to be started. The wpthird.ini file is found in the "shlib" directory under the Wordperfect installation directory. The wpthird.ini file is a text file that contains a line for each third-party program, formatted as shown below:

logical_name:path/filename

The logical_name is some arbitrary identifier of the program that could indicate its name or function. An example is:

grammar:/usr/local/bin/gcheck

In this example the arbitrary logical name is "grammar." The path is "/user/local/bin/," and the file name of the third-party program is "gcheck." Using logical names with the example above, you could have two or more entries in the "wpthird.ini" file that reference gcheck. However, each one would have a different logical name. This may not seem too useful for third-party programs accessing only WordPerfect 5.1, but as more WordPerfect products get this interface it may become more important to avoid conflicts.

WordPerfect executes each third-party program in turn, using the path from wpthird.ini. WordPerfect passes two parameters to the third-party program. The parameters are the file descriptors of the communication channels to use with WordPerfect and are accessible to the third-party program as argv[1] and argv[2]. The program "reads" the descriptor argv[1] for communications from WordPerfect. The program "writes" the descriptor argv[2] to send communications to WordPerfect. The descriptors are ASCII strings and must be converted to integers for use in read and write calls.

Note:	This method of having WP 5.1 run your TPI program from the THIRD.INI file is not supported on SCO Xinix.

The first communication sent to the third-party program is an initialization packet. It is formatted as shown below.

total len	state	token	name len	name	product	major	minor

total len	Two bytes stored in Intel order that indicate the total length of data following.

state	4 bytes stored in Intel order containing state flags from the application

token	Two bytes stored in Intel order that contain 0xFFFF. This token value identifies the initialization packet.

name len	Two bytes stored in Intel order that indicate the length of the name field.

name	Null-terminated byte string that contains the logical name of the third-party program as read from the wpthird.ini file.

product	One byte identifying the WordPerfect application that started the third-party application (1 for WordPerfect 5.1 graphical, 2 for WordPerfect 5.1 character).

major	One byte identifying the major version of the WordPerfect application (5 for WordPerfect 5.1).

minor	One byte identifying the minor version of the WordPerfect application (1 for WordPerfect 5.1).

After receiving the initialization packet, the third-party program acknowledges it can communicate by returning a communication formatted as shown below.

total len	low bound	high bound

total len	Two bytes stored in Intel order that indicate the total length of data following (always four).

low bound	Two bytes stored in Intel order. The lower bound of the token range that the third-party program wants to see.

high bound	Two bytes stored in Intel order. The upper bound of the token range that the third-party program wants to see.

If the third-party program does not want to communicate with the WordPerfect application, it sets both the lowand high-bound values to 0. For example, if your program wants to communicate only with the character version of WP, but a GUI version of WP calls you, you would use this method to avoid the GUI version.

To see all tokens, the third-party program should set the low bound to 0 and the upper bound to 0xFFFF.

Setting the token bounds appropriately has significant affects on performance. It lets WordPerfect avoid incurring the IPC overhead associated with sending unnecessary tokens to the third-party program.

Keyboard Input Handling

After every entered keystroke or menu selection, the third-party program receives a communication formatted as illustrated in the following diagram.

total len	state	token	...

Each communication consists of a "total len" field followed by the state and an arbitrary number of tokens. The third-party program should interpret the fields as follows:

total len	Two bytes stored in Intel order that indicate the total length of data that follows.

state	Four bytes stored in Intel order that contain state flags from the application.

token	Two bytes stored in Intel order that contain a WordPerfect application token.

The third-party program examines each communication and returns a communication to the WordPerfect application formatted as shown below.

total len	state	token	...

The third-party program can pass the data back unchanged, replace one or more tokens with other tokens, or delete one or more tokens. To delete the entire buffer, the third-party program returns a communication with the "total len" field set to 0. To delete individual tokens, the tokens are simply removed from the communication and the "total len" field adjusted accordingly. Likewise, tokens can be replaced by removing a token(s) from the communication, inserting the replacement token(s) and adjusting the "total len" field if necessary.

There are three generalized types of tokens. These generalized tokens are: tokens without parameters, Key-code tokens, and variable-length tokens. Each token has the following format in the buffer:

Token: no parameters	token	...
Token: Key Code	key code (2 bytes)	...
Token: with parameters	token	parameter len (2 bytes)	parameters (var.)	...

The state field is passed back to WP intact unless the buffer is deleted. The state field must be the same as received by the third-party application, since the communication may be passed on to the other third-party programs. Consider the state field a read-only field.

If multiple third-party programs are present, the WordPerfect application sends communications to each thirdparty program in turn, then each third-party program receives the results of the exchange with the previous thirdparty program and WP. The third-party programs are called in the order they appear in the wpthird.ini file (explained below).

If a program calls WP with the "-third" flag, that program is the only one that can communicate with WordPerfect. In this case the programs listed in the .ini file are disregarded. Either the .ini list or the program calling with the "third" switch is called, but not both.

When dealing with multiple programs, WordPerfect sends one token to the first program in the "chain." This token represents the last interaction performed by the user. However, since multiple third-party programs may be present, the token may change and add to the contents of the buffer. Since your third-party program doesn't know if it is the first program was accessed by WP or not, your program must be prepared to handle multiple tokens in the buffer as well as a variable length buffer.

If multiple third-party programs are present, the WordPerfect application ensures that empty communications (that is, "total len" equals 0) are not sent to any third-party program. Therefore, communications received by the third-party application contain at least one token.

Interaction between the WordPerfect application and the third-party program

In response to some event (such as a key press) a token is generated in the WordPerfect application. The WordPerfect application creates a communication that contains the token and writes it on the ipc channel to the third-party program. At this point the WordPerfect application does a blocking read on the ipc channel from the third-party program. While this is taking place, the third-party program is doing a blocking read on (or otherwise monitoring) the ipc channel from the WordPerfect application. The third-party program first reads two bytes and uses the two bytes as the length for a subsequent read of the remainder of the communication. The third-party program processes the communication, modifies it if desired, and sends it back to the WordPerfect application. The third-party program then waits for another communication from the WordPerfect application.

Termination

When exiting, the WordPerfect application sends a communication that contains 0xFFFFFFFF in the state field. The third-party program should use this as the signal to terminate.

Program Notes

If you are using file descriptors, be aware that close_on_exec is not set when WP 5.1 terminates from a TPI session.

When WP 5.1 terminates, you cannot assume what stdin and stdout will reflect. Both should be reset.

State Flags for WordPerfect

bit 0	=	unused

bit 1	=	unused

bit 2	=	1 main editing screen (not in a menu)

bit 3	=	1 a structure other than the main document (footer, header, text box, and so forth) is being edited

bit 4	=	1 macro being defined

bit 5	=	1 macro being executed

bit 6	=	1 merge active

bit 7	=	1 block on

bit 8	=	1 typeover mode, = 0 insert mode

bit 9	=	Reveal Codes active

bit 10	=	1 Yes/No prompt active, Character Version Only

bit 11	=	1 list active, Character Version Only

bit 12	=	1 In Help (In Help document in GUI)

bit 15	=	1 cannot go to Shell or UNIX (cleared when at the main menu, Character Version Only)

bits 16-19	=	document number (1-9)

bit 20	=	WP polling TPI program (no user event has taken place)

bits 21-31	=	Reserved (bits may be set or cleared, but it's meaningless)

C Sample Program

The Toolkit diskette contains a sample program that uses the interface described above to communicate with the WordPerfect program. The UNIXTPI.C program is a sample third-party program written in the "C" programming language. The program is unpolished, but shows how the third-party interface communicates with WordPerfect.

Key Codes

See the reference manuals of each product for an explanation of the individual characters in character sets 0–12 (subsets of the WordPerfect master character set).

Normal Characters (Graphical and Character Version)

High Byte	Low Byte	Meaning

0	0x20–0x7E	ASCII characters

Extended Characters (Graphical and Character Version)

High Byte	Low Byte	Meaning

1	0–0xE9	Multinational, one character

2	0–0x1B	Multinational, two characters

3	0–0x43	Box drawing characters

4	0–0x44	Typographic characters

5	0–0x22	Iconic characters

6	0–0xDA	Math characters

7	0–0xDE	Math extension characters

8	0–0xC7	Greek characters

9	0–0x2B	Hebrew characters

0x0A	0–0x65	Cyrillic characters

0x0B	0–0x63	Japanese characters (Hiragana and Katakana)

0x0C	0–0xFF	User-defined characters

0x0D–0x7F	0–0x2FF	Reserved

WordPerfect Keys

Control Characters (Graphical and Character Version)

High Byte	Low Byte	Meaning

0x80	0	^@	Compose (cannot be entered by third-party interface)

0x80	1	^A

0x80	2	^B	Page number

0x80	3	^C	Merge from console

0x80	4	^D	Merge date

0x80	5	^E	Merge end of record

0x80	6	^F	Merge field

0x80	7	^G	Merge macro

0x80	8	^H	Home

0x80	9	^I	Tab

0x80	0x0A	^J	Enter

0x80	0x0B	^K	Delete to end of line

0x80	0x0C	^L	Delete to end of page

0x80	0x0D	^M	Search value for [SRt]

0x80	0x0E	^N	Merge next record

0x80	0x0F	^O	Merge output prompt

0x80	0x10	^P	Merge primary filename

0x80	0x11	^Q	Merge quit

0x80	0x12	^R	Merge return

0x80	0x13	^S	Merge secondary filename

0x80	0x14	^T	Merge text to printer

0x80	0x15	^U	Merge update the screen

0x80	0x16	^V	Ignore meaning of following code

0x80	0x17	^W	Up Arrow

0x80	0x18	^X	Right Arrow

0x80	0x19	^Y	Left Arrow

0x80	0x1A	^Z	Down Arrow

0x80	0x1B	^[	Escape

0x80	0x1C	^\

0x80	0x1D	^]

0x80	0x1E	^^	Reset keyboard map (cannot be entered by third-party interface)

0x80	0x1F	^_

WordPerfect Function Keys (Graphical and Character Version)

Function Keys

Character	Character	Graphical	Graphical

High Byte	Low Byte	High Byte	Low Byte	Meaning

0x80	0x20	0x40	0x20	Cancel

0x80	0x21	0x40	0x21	Forward Search

0x80	0x22	0x40	0x22	Help

0x80	0x23	0x80	0x23	Indent

0x80	0x24	0x40	0x24	List Files

0x80	0x25	0x80	0x25	Bold

0x80	0x26	0x40	0x26	Exit

0x80	0x27	0x80	0x27	Underline

0x80	0x28	0x80	0x28	End Field

0x80	0x29	0x40	0x80	Save

0x80	0x2A	0x80	0x3a	Reveal Codes

0x80	0x2B	0x80	0x3b	Block

Shift + Function Keys

Character	Character	Graphical	Graphical

High Byte	Low Byte	High Byte	Low Byte	Meaning

0x80	0x2C	0x80	0x2c	Setup

0x80	0x2D	0x40	0x2D	Backward Search

0x80	0x2E	0x80	0x2E	Switch

0x80	0x2F	0x80	0x2F	Left/Right Indent

0x80	0x30	0x80	0x30	Date/Outline

0x80	0x31	0x80	0x31	Center

0x80	0x32	0x40	0xCA	Print

0x80	0x33	0x80	0x33	Format

0x80	0x34	0x40	0x34	Merge Commands

0x80	0x35	0x40	0x35	Retrieve

0x80	0x36	0x80	0x36	Shift-F11

0x80	0x37	0x80	0x37	Shift-F12

Alt + Function Keys

Character	Character	Graphical	Graphical

High Byte	Low Byte	High Byte	Low Byte	Meaning

0x80	0x38	0x40	0x38	Thesaurus

0x80	0x39	0x40	0x39	Search/Replace

0x80	0x3A	0x80	0x3A	Reveal Codes

0x80	0x3B	0x80	0x3B	Block

0x80	0x3C	0x80	0x3C	Mark Text

0x80	0x3D	0x80	0x3D	Flush Right

0x80	0x3E	0x80	0x3E	Columns/Table

0x80	0x3F	0x40	0x3F	Style

0x80	0x40	0x80	0x40	Graphics

0x80	0x41	0x40	0x41	Macro

0x80	0x42	0x80	0x42	Alt-F11

0x80	0x43	0x80	0x43	Alt-F12

Control + Function Keys

Character	Character	Graphical	Graphical

High Byte	Low Byte	High Byte	Low Byte	Meaning

0x80	0x44	0x80	0x44	Shell (Reserved for Graphical)

0x80	0x45	0x40	0x45	Spell

0x80	0x46	0x80	0x46	Screen

0x80	0x47	0x80	0x47	Move

0x80	0x48	0x80	0x48	Text In/Out

0x80	0x49	0x40	0x49	Tab Align

0x80	0x4A	0x80	0x4A	Footnote

0x80	0x4B	0x40	0xE9	Font

0x80	0x4C	0x80	0x4C	Merge/Sort

0x80	0x4D	0x40	0x4D	Define Macro

0x80	0x4E	0x80	0x4E	Ctrl-F11

0x80	0x4F	0x80	0x4F	Ctrl-F12

WordPerfect Key Commands (Graphical and Character Version)

Character	Character	Graphical	Graphical

High Byte	Low Byte	High Byte	Low Byte	Meaning

0x80	0x50	0x80	0x50	Backspace

0x80	0x51	0x80	0x51	Delete Right

0x80	0x52	0x80	0x52	Delete Word

Character	Character	Graphical	Graphical

High Byte	Low Byte	High Byte	Low Byte	Meaning

0x80	0x53	0x80	0x53	Word Right

0x80	0x54	0x80	0x54	Word Left

0x80	0x55	0x80	0xC3	Home, Home, Right (End key)

0x80	0x56	0x80	0xC3	Home, Home, Left

0x80	0x57	0x80	0x57	Keyboard Input from Macro

0x80	0x58	0x40	0x58	Go To

0x80	0x59	0x80	0x59	PgUp

0x80	0x5A	0x80	0x5A	PgDn

0x80	0x5B	0x80	0x5B	Screen Down

0x80	0x5C	0x80	0x5C	Screen Up

0x80	0x5D	0x80	0x5D	Typeover

0x80	0x5E	0x80	0x5E	Left Margin Rel. (Shift-Tab)

0x80	0x5F	0x80	0x5F	Hard Page (Ctrl-Enter)

0x80	0x60	0x80	0x60	Soft Hyphen

0x80	0x61	0x0	0x2d	Hard Hyphen

0x80	0x62	0x80	0x62	Hard Space

WordPerfect Token Commands (Without Parameters)

High Byte	Low Byte	Meaning

0x80	0x29	Block Table Cell

0x80	0x2A	Block Table Row

0x80	0x2B	Block Table Column

0x80	0x44	Convert Comment to Text

0x80	0x6B	Edit ToA Full Form

0x80	0x6F	Show/hide ruler

0x80	0x70	Paste Block

0x80	0x71	Copy Block

0x80	0x72	Cut Block

0x80	0x73	New Document

0x80	0x74	Reset Attributes to Normal

0x80	0x75	Double Underline

0x80	0x76	Italics

0x80	0x77	Outline

0x80	0x78	Shadow

0x80	0x79	Small Cap

0x80	0x7A	Redline

0x80	0x7B	Strikeout

0x80	0x7C	Superscript

0x80	0x7D	Subscript

0x80	0x7E	Fine

0x80	0x80	Small

0x80	0x81	Large

0x80	0x82	Very Large

0x80	0x83	Extra Large

0x80	0x84	Quit WP

0x80	0x85	Date Text

0x80	0x86	Date Code

0x80	0x87	Info

0x80	0x88	Hanging Indent

0x80	0x89	Center Page

0x80	0x8A	Block Protect

0x80	0x8B	Word Count

0x80	0x8C	Button Panel

0x80	0x8D	Block the word the cursor is on

0x80	0x8E	Block the sentence the cursor is on

0x80	0x8F	Block the paragraph the cursor is on

0x80	0x90	Block the page the cursor is on

0x80	0x91	Column Block

0x80	0x92	Rectangle Block

0x80	0x93	Widow/Orphan On/Off

High Byte	Low Byte	Meaning

0x80	0x94	Reserved

0x80	0x95	Toggle Columns

0x80	0x96	Save All

0x80	0x97	Footnote Create

0x80	0x98	Endnote Create

0x80	0x99	Expand Master Document

0x80	0x9A	Header Footer Display

0x80	0x9B	Footnote/Endnote Display

0x80	0x9C	Graphics Display

0x80	0x9D	Columns Off

0x80	0x9E	No Columns

0x80	0x9F	Box Number

0x80	0xA0	Calculate Tables

0x80	0xA1	Keystroke for goto

0x80	0xA2	Convert to upper case

0x80	0xA3	Convert to lower case

0x80	0xA4	Insert page #

0x80	0xA5	Initial Codes (current document)

0x80	0xA6	Initial Codes (all documents)

0x80	0xA7	Outline On/Off

0x80	0xA8	Outline Move Family

0x80	0xA9	Outline Copy Family

0x80	0xAA	Outline Delete Family

0x80	0xAB	Select Word Left

0x80	0xAC	Select Character Left

0x80	0xAD	Select Word Right

0x80	0xAE	Select Character Right

0x80	0xAF	Select Paragraph Up

0x80	0xB0	Select Line Up

0x80	0xB1	Select Paragraph Down

0x80	0xB2	Select Line Down

0x80	0xB3	Select All

0x80	0xB4	Deselect All

0x80	0xB5	Default Button Bar

0x80	0xB7	Text Box Create

0x80	0xB8	Subdocument Cancel

0x80	0xBA	Previous Footnote/Endnote

0x80	0xBB	Next Footnote/Endnote

0x80	0xBC	Table Join

0x80	0xBD	Insert a tab inside a table

0x80	0xBE	Insert a margin release in a table

0x80	0xBF	Table Insert Row

0x80	0xC0	Table Delete Row

WordPerfect Dialog Commands (Graphical Version Only)

These commands open dialogs.

High Byte	Low Byte	Meaning

0x40	0x00	Reserved

0x40	0x01	Condense Master Document

0x40	0x02	Compare Documents

0x40	0x03	Mark Full Table of Authorities Entry

0x40	0x04	Mark Short Table of Authorities Entry

0x40	0x05	Mark Cross-reference

0x40	0x06	Mark List Entry

0x40	0x07	Mark Index Entry

0x40	0x08	Mark Table of Contents Entry

0x40	0x09	Create/Remove Redline/Strikeout Markings

0x40	0x0A	Create Subdocument

0x40	0x0B	Typesetting options

0x40	0x0C	Insert Printer Command

0x40	0x0D	Manual Kerning

0x40	0x0E	Columns Define

0x40	0x0F	Add Macro to Menu

0x40	0x10	Delete Macro from Menu

0x40	0x11	Document Summary

0x40	0x12	Search/Replace

0x40	0x13	Spreadsheet Import

0x40	0x14	Spreadsheet Create

0x40	0x15	Spreadsheet Edit

0x40	0x16	Spreadsheet Update

0x40	0x17	Spreadsheet Link Options

0x40	0x18	Generate

0x40	0x19	Append To File

0x40	0x1A	Wp Character Set Dialog

0x40	0x1B	Reserved

0x40	0x1C	Line Spacing

0x40	0x1D	Line Height

0x40	0x1E	Line Numbering

0x40	0x1F	Hyphenation

0x40	0x20	Undelete

0x40	0x21	Forward Search

0x40	0x22	Help

0x40	0x23	Select Language

0x40	0x24	File Manager

0x40	0x25	Reserved

0x40	0x26	Exit

High Byte	Low Byte	Meaning

0x40	0x27	Button Panel Retrieve

0x40	0x28	Reserved

0x40	0x29	Save

0x40	0x2A-0x2C	Reserved

0x40	0x2D	Backward Search

0x40	0x2E-0x33	Reserved

0x40	0x34	Merge Commands

0x40	0x35	Insert (retrieve)

0x40	0x36-0x37	Reserved

0x40	0x38	Thesaurus

0x40	0x39	Search and Replace

0x40	0x3A	Define List

0x40	0x3B	Define Index

0x40	0x3C	Define Table of Contents

0x40	0x3D	Define Table of Authorities

0x40	0x3E	Math Define

0x40	0x3F	Styles

0x40	0x40	Reserved

0x40	0x41	Retrieve Macro and Execute

0x40	0x42-0x44	Reserved

0x40	0x45	Speller

0x40	0x46-0x48	Reserved

0x40	0x49	Tab Align

0x40	0x4A-0x4B	Reserved

0x40	0x4C	Sort

0x40	0x4D	Macro Define

0x40	0x4E-0x51	Reserved

0x40	0x52	Separators: Decimal Align and Thousands

0x40	0x53	Table Undelete

0x40	0x54	Table Options

0x40	0x55	Zoom

0x40	0x56	Table Split

0x40	0x57	Table Create

0x40	0x58	Go To

0x40	0x59	Figure Box Retrieve

0x40	0x5A	Figure Box Create

0x40	0x5B	Figure Box Edit

0x40	0x5C	Figure Box Position

0x40	0x5D	Figure Box Caption

0x40	0x5E	Figure Box New Number

0x40	0x5F	Figure Box Options

0x40	0x60	Reserved

0x40	0x61	Text Box Edit

High Byte	Low Byte	Meaning

0x40	0x62	Text Box Position

0x40	0x63	Text Box Caption

0x40	0x64	Text Box New Number

0x40	0x65	Text Box Options

0x40	0x66	Text Box Rotate

0x40	0x67	Equation Box Create

0x40	0x68	Equation Box Edit

0x40	0x69	Equation Box Position

0x40	0x6A	Equation Box Caption

0x40	0x6B	Equation Box New Number

0x40	0x6C	Equation Box Options

0x40	0x6D	Table Box Create

0x40	0x6E	Table Box Edit

0x40	0x6F	Table Box Position

0x40	0x70	Table Box Caption

0x40	0x71	Table Box New Number

0x40	0x72	Table Box Options

0x40	0x73	User Box Create

0x40	0x74	User Box Edit

0x40	0x75	User Box Position

0x40	0x76	User Box Caption

0x40	0x77	User Box New Number

0x40	0x78	User Box Options

0x40	0x79	Reserved

0x40	0x7A	Equation Editor

0x40	0x7B	Overstrike Create

0x40	0x7C	Overstrike Edit

0x40	0x7D	Paragraph Number Insert/Level

0x40	0x7E	Define Outline

0x40	0x7F	Delete Options

0x40	0x80	Save As

0x40	0x81	Exit Save As

0x40	0x82	Replace file

0x40	0x83	Macro Edit

0x40	0x84	Password

0x40	0x85	Reserved

0x40	0x86	Table Create

0x40	0x87	New Footnote Number

0x40	0x88	New Endnote Number

0x40	0x89	Date Format

0x40	0x8A	Setup Backup Options

0x40	0x8B	Setup Beep Options

0x40	0x8C	Setup Date Format

High Byte	Low Byte	Meaning

0x40	0x8D	Setup Display

0x40	0x8E	Setup Document Summary

0x40	0x8F	Setup Equations

0x40	0x90	Setup Hyphenation

0x40	0x91	Setup Keyboard Layout

0x40	0x92	Setup Location of Files

0x40	0x93	Setup Merge Options

0x40	0x94	Setup Print Options

0x40	0x95	Setup Save/Retrieve Options

0x40	0x96	Setup Size Options

0x40	0x97	Setup Table Of Authorities

0x40	0x98	Setup Units Of Measure

0x40	0x99	Setup WYSIWYG Options

0x40	0x9A	Comment Create

0x40	0x9B-0x9C	Reserved

0x40	0x9D	Margins

0x40	0x9E	Suppress Options

0x40	0x9F	Conditional End of Page

0x40	0xA0	Open Window Retrieve

0x40	0xA1	Comment Edit

0x40	0xA2	Open on document windows

0x40	0xA3	New on document windows

0x40	0xA4	Headers

0x40	0xA5	Footers

0x40	0xA6	Word Lookup

0x40	0xA7	Tabs

0x40	0xA8	Color

0x40	0xA9	Reserved

0x40	0xAA	Table Delete

0x40	0xAB	Table Cell Options

0x40	0xAC	Table Column Options

0x40	0xAD	Table Row Options

0x40	0xAE	Table Lines Options

0x40	0xAF	Table Formula

0x40	0xB0	Create a Horizontal Line

0x40	0xB1	Edit a Horizontal Line

0x40	0xB2	Create a Vertical Line

0x40	0xB3	Edit a Vertical Line

0x40	0xB4	Style Properties

0x40	0xB5	Outline Styles

0x40	0xB6	Delete Style

0x40	0xB7	Execute Merge

0x40	0xB8	Advance

High Byte	Low Byte	Meaning

0x40	0xB9	Insert Special Codes (Tabs)

0x40	0xBA	Page Numbering

0x40	0xBB	User Restrictions

0x40	0xBC	Footnote Edit

0x40	0xBD	File Locking

0x40	0xBE	Endnote Edit

0x40	0xBF	Footnote Options

0x40	0xC0	Endnote Options

0x40	0xC1	Endnote Placement

0x40	0xC2	Redline Method

0x40	0xC3	Reserved

0x40	0xC4	Select Text Color (for printing)

0x40	0xC5	Job Type from Print Options Setup

0x40	0xC6	Save Subdocument during condense master

0x40	0xC7	Customized/In-House Help Dialog

0x40	0xC8	UNIX Mail

0x40	0xC9	WP Office Mail

0x40	0xCA	Print

0x40	0xCB	Reserved

0x40	0xCC	Print Settings

0x40	0xCD-0xCE	Reserved

0x40	0xCF	Printer Select

0x40	0xD0-0xFF	Reserved

WordPerfect Token Commands (With Parameters)

These commands do not bring up dialogs, but do the required work when a dialog is applied. Each of these commands has associated data as described in Tokens and Their Parameter Formats later in this section.

High Byte	Low Byte	Mnemonic	Meaning

0x20	0x00	Reserved

0x20	0x01	WCONDENSE	Condense Master Document

0x20	0x02	WDOCCMP	Compare Documents

0x20	0x03	WMRKFTOA	Mark Full Table of Authorities Entry

0x20	0x04	WMRKSTOA	Mark Short Table of Authorities Entry

0x20	0x05	WMRKXREF	Mark Cross-reference

0x20	0x06	WMRKLST	Mark List Entry

0x20	0x07	WMRKINDX	Mark Index Entry

0x20	0x08	WMRKTOC	Mark Table of Contents Entry

0x20	0x09	WRMVRED	Create/Remove Redline/Strikeout Markings

0x20	0x0A	WSUBDOC	Create Subdocument

0x20	0x0B	WTYPESET	Typesetting Options

0x20	0x0C	WINSPCMD	Insert Printer Command

0x20	0x0D	WMANKERN	Manual Kerning

0x20	0x0E	WCOLMNDEF	Columns Define

0x20	0x0F	WMACADD	Add Macro to Menu

0x20	0x10	WMACDEL	Delete Macro from Menu

0x20	0x11	WDOCSUM	Document Summary

0x20	0x12	Reserved

0x20	0x13	WSPREADIMPORT	Spreadsheet Import

0x20	0x14	WSPREADCREATE	Spreadsheet Create

0x20	0x15	WSPREADEDIT	Spreadsheet Edit

0x20	0x16	WSPREADUPDATE	Spreadsheet Update

0x20	0x17	WSPREADLINK	Spreadsheet Link Options

0x20	0x18	WGENERATE	Generate

0x20	0x19	WAPPEND	Append To File

0x20	0x1A-0x1B	Reserved

0x20	0x1C	WLNSPC	Line Spacing

0x20	0x1D	WLNHGT	Line Height

0x20	0x1E	WLNNUM	Line Numbering

0x20	0x1F	WLNHYP	Hyphenation

0x20	0x20	WCAN	Undelete

0x20	0x21	WFS	Forward Search

High Byte	Low Byte	Mnemonic	Meaning

0x20	0x22	WHELP	Help

0x20	0x23	WLANG	Select Language

0x20	0x24-0x25	Reserved

0x20	0x26	WEXR	Exit Document

0x20	0x27	WBTNRET	Button Panel Retrieve

0x20	0x28-0x29	Reserved

0x20	0x2A	WSTYOFF	Turn Style Off

0x20	0x2B	WSTYON	Turn Style On

0x20	0x2C	Reserved

0x20	0x2D	WBS	Backward Search

0x20	0x2E	WDCSW	Switch/Create

0x20	0x2F-0x33	Reserved

0x20	0x34	WMRCM	Merge Commands

0x20	0x35	WIN	Retrieve file

0x20	0x36-0x38	Reserved

0x20	0x39	WSAR	Search and Replace

0x20	0x3A	WDFLIST	Define List

0x20	0x3B	WDFINDEX	Define Index

0x20	0x3C	WDFTOC	Define Table of Contents

0x20	0x3D	WDFTOA	Define Table of Authorities

0x20	0x3E	WMTCL	Math Define

0x20	0x3F-0x40	Reserved

0x20	0x41	WINB	Retrieve Macro and Execute

0x20	0x42-0x4B	Reserved

0x20	0x4C	WSORT	Sort

0x20	0x4D-0x51	Reserved

0x20	0x52	WSEPART	Decimal Align and Thousands separator

0x20	0x53	Reserved

0x20	0x54	TABLOPT	Table Options

0x20	0x55	WZOOMCHANGE	Zoom

0x20	0x56	TABLSPLT	Table Split

0x20	0x57	TABLINS	Table Create

0x20	0x58	WGO	Go To

0x20	0x59	WFGBOXRET	Figure Box Retrieve

0x20	0x5A	WFGBOXCRT	Figure Box Create

0x20	0x5B	WFGBOXEDIT	Figure Box Edit

0x20	0x5C	WFGBOXPOS	Figure Box Position

0x20	0x5D	WFGBOXCAPT	Figure Box Caption

0x20	0x5E	WFGBOXNWNM	Figure Box New Number

0x20	0x5F	WFGBOXOPT	Figure Box Options

0x20	0x60	Reserved

0x20	0x61	WTXBOXEDIT	Text Box Edit

High Byte	Low Byte	Mnemonic	Meaning

0x20	0x62	WTXBOXPOS	Text Box Position

0x20	0x63	WTXBOXCAPT	Text Box Caption

0x20	0x64	WTXBOXNWNM	Text Box New Number

0x20	0x65	WTXBOXOPT	Text Box Options

0x20	0x66	WTEXTROT	Text Box Rotate

0x20	0x67	WEQBOXCRT	Equation Box Create

0x20	0x68	WEQBOXEDIT	Equation Box Edit

0x20	0x69	WEQBOXPOS	Equation Box Position

0x20	0x6A	WEQBOXCAPT	Equation Box Caption

0x20	0x6B	WEQBOXNWNM	Equation Box New Number

0x20	0x6C	WEQBOXOPT	Equation Box Options

0x20	0x6D	WTBBOXCRT	Table Box Create

0x20	0x6E	WTBBOXEDIT	Table Box Edit

0x20	0x6F	WTBBOXPOS	Table Box Position

0x20	0x70	WTBBOXCAPT	Table Box Caption

0x20	0x71	WTBBOXNWNM	Table Box New Number

0x20	0x72	WTBBOXOPT	Table Box Options

0x20	0x73	WUSBOXCRT	User Box Create

0x20	0x74	WUSBOXEDIT	User Box Edit

0x20	0x75	WUSBOXPOS	User Box Position

0x20	0x76	WUSBOXCAPT	User Box Caption

0x20	0x77	WUSBOX	User Box New Number

0x20	0x78	WUSBOXOPT	User Box Options

0x20	0x79-0x7A	Reserved

0x20	0x7B	WOVRSTKC	Overstrike Create

0x20	0x7C	Reserved

0x20	0x7D	WPARANUM	Paragraph Number Insert/Level

0x20	0x7E	WDEFOTLN	Define Outline

0x20	0x7F	WSETDELO	Delete Options

0x20	0x80-0x8	Reserved

0x20	0x82	WSAVREP	Save/Replace file

0x20	0x83-0x85	Reserved

0x20	0x86	WCRTTBL	Table Create

0x20	0x87	WFNN	New Footnote Number

0x20	0x88	WENN	New Endnote Number

0x20	0x89	WDATEDEF	Date Format

0x20	0x8A	WSETBACK	Setup Backup Options

0x20	0x8B	WSETBEEP	Setup Beep Options

0x20	0x8C	WSETDATE	Setup Date Format

0x20	0x8D	WSETDISP	Setup Display

0x20	0x8E	WSETSUMM	Setup Document Summary

0x20	0x8F	WSETEQUA	Setup Equations

High Byte	Low Byte	Mnemonic	Meaning

0x20	0x90	WSETHYPH	Setup Hyphenation

0x20	0x91	WKEYBD	Setup Keyboard Layout

0x20	0x92	WSETFILES	Setup Location of Files

0x20	0x93	WSETMERGE	Setup Merge Options

0x20	0x94	WSETPRINT	Setup Print Options

0x20	0x95	WSETSVRET	Setup Save/Retrieve Options

0x20	0x96	WSETSIZE	Setup Size Options

0x20	0x97	WSETTOA	Setup Table Of Authorities

0x20	0x98	WSETUNITS	Setup Units Of Measure

0x20	0x99	WSETWYSI	Setup WYSIWYG Options

0x20	0x9A	WCOMMENTC	Comment Create

0x20	0x9B	WPJUST	Justification

0x20	0x9C	WPTABTYP	Set Default Tab Type

0x20	0x9D	WMARGINS	Margins

0x20	0x9E	WSUPPRESS	Suppress Options

0x20	0x9F	WCEOP	Conditional End of Page

0x20	0xA0	WOPDOC	Open Window Retrieve

0x20	0xA1	WCOMMENTE	Comment Edit

0x20	0xA2	Reserved

0x20	0xA3	WCLEAR	Clear Document Window

0x20	0xA4	WHEADER	Headers

0x20	0xA5	WFOOTER	Footers

0x20	0xA6	Reserved

0x20	0xA7	WTABSET	Tabs

0x20	0xA8	WSETCOLOR	Color

0x20	0xA9	WSETDEFS	X Defaults

0x20	0xAA	TABLDEL	Table Delete

0x20	0xAB	TABLCELL	Table Cell Options

0x20	0xAC	TABLCOL	Table Column Options

0x20	0xAD	TABLROW	Table Row Options

0x20	0xAE	TABLLINE	Table Lines Options

0x20	0xAF	TABLFORM	Table Formula

0x20	0xB0	WHORZLN	Create a Horizontal Line

0x20	0xB1	WEDITHLN	Edit a Horizontal Line

0x20	0xB2	WVERTLN	Create a Vertical Line

0x20	0xB3	WEDITVLN	Edit a Vertical Line

0x20	0xB4-0xB6	Reserved

0x20	0xB7	WDOMRG	Execute Merge

0x20	0xB8	WADVANCE	Advance

0x20	0xB9	WINSTAB	Insert Special Codes (Tabs)

0x20	0xBA	WPAGNUM	Page Numbering

0x20	0xBB	Reserved

0x20	0xBC	WFTNED	Footnote Edit

High Byte	Low Byte	Mnemonic	Meaning

0x20	0xBD	Reserved

0x20	0xBE	WENDED	Endnote Edit

0x20	0xBF	WFTNOPT	Footnote Options

0x20	0xC0	WENDOPT	Endnote Options

0x20	0xC1	WENDPLA	Endnote Placement

0x20	0xC2	WREDM	Redline Method

0x20	0xC3	Reserved

0x20	0xC4	WSELCOLOR	Select Text Color (for printing)

0x20	0xC5	WSUJTYPE	Job Type from Print Options Setup

0x20	0xC6	WSVSUBDOC	Save Subdocument during condense master

0x20	0xC7	WHLPCUST	Customized/In-House Help

0x20	0xC8	WPUMAIL	UNIX Mail

0x20	0xC9	WPOMAIL	WP Office Mail

0x20	0xCA	WPRTMNU	Print

0x20	0xCB	Reserved

0x20	0xCC	WPRTSET	Print Settings

0x20	0xCD	WPRNTSET	Print Settings

0x20	0xCE	WPSJTYPE	Print Settings Job Type

0x20	0xCF-0xDB	Reserved

0x20	0xDC	WJOBGO	Get new range of pages to restart print job.

0x20	0xDD-0xE7	Reserved

0x20	0xE8	WDOCIFNT	Document Initial Font

0x20	0xE9	WPFONT	Base Font

0x20	0xEA-0xF2	Reserved

0x20	0xF3	WPAPSIZ	Paper Size/Type

0x20	0xF4	WALLOTHER	Paper Size/ALL OTHERS

0x20	0xF5	WADDPST	Add Paper Size and Type

0x20	0xF6	WEDITPST	Edit Paper Size and Type

0x20	0xF7	WCOPYPST	Copy Paper Size and Type

0x20	0xF8	WDELPST	Delete Paper Size and Type

0x20	0xF9-0xFA	Reserved

0x20	0xFB	WEDLABL	Edit Labels

0x20	0xFC-0xFF	Reserved

Macro Commands (Graphical and Character Version)

WordPerfect 5.1

High Byte	Low Byte	Meaning

0x0FC	0x3A	{~} (hard tilde)

0x0FC	0x0B	{;}comment~ (comment – do not execute)

0x0FC	0x1	{ASSIGN}var~value~ (assign value to var)

0x0FC	0x2	{BELL} (sound bell)

0x080	0x6C	{Block append}

0x080	0x6E	{Block Copy}

0x080	0x6D	{Block Move}

0x0FC	0x3	{BREAK} (leave current for IF, FOR, or WHILE loops)

0x0FC	0x4	{CALL}label~ (call subroutine in same file)

0x0FC	0x5	{CANCEL OFF} (ignore cancel)

0x0FC	0x6	{CANCEL ON} (allow cancel)

0x0FC	0x7	{CASE}val~case1~label1~c2~l2~...~~ (goto label
val=case)

0x0FC	0x8	{CASE CALL}val~c1~l1~c2~l2~...~~ (call label val=case)

0x0FC	0x9	{CHAIN}file~ (execute after current macro)

0x0FC	0x0A	{CHAR}var~message~ (input single character into var)

0x0FC	0x0C	{DISPLAY OFF} (turn off display)

0x0FC	0x0D	{DISPLAY ON} (turn on display)

0x0FC	0x0E	{ELSE} (else portion of IF)

0x0FC	0x0F	{END FOR} (end of FOR/FOR EACH loop)

0x0FC	0x10	{END IF} (end of IF command)

0x0FC	0x11	{END WHILE} (end of WHILE loop)

0x0FC	0x12	{FOR}var~start~stop~step~ (for loop END FOR)

0x0FC	0x13	{FOR EACH}var~value~value~...~~ (loop with var assigned to each value)

0x0FC	0x14	{GO}label~ (jump to the label)

0x0FC	0x15	{IF}value~ (true if value !0 ELSE 0 END IF)

0x0FC	0x2F	{IF EXISTS}var~ (true if a value is assigned)

0x0FC	0x33	{INPUT}message~ (Prompt, input until F-9 pressed [Merge R])

0x080	0x68	{Item Down}

0x080	0x65	{Item Left}

0x080	0x66	{Item Right}

0x080	0x67	{Item Up}

0x0FC	0x38	{KTON}key~ (convert key to number)

0x0FC	0x39	{LEN}var~ (get length of var)

0x0FC	0x16	{LABEL}label~ (label for CALL, GO, and so forth)

0x0FC	0x17	{LOOK}var~ (tstkb type of {CHAR})

High Byte	Low Byte	Mnemonic	Meaning

0x0FC	0x2C	{Macro Commands} (application program access to macro commands)

0x0FC	0x30	{MENU OFF} (menu display off) Character Version Only

0x0FC	0x31	{MENU ON} (menu display on) Character Version Only

0x0FC	0x36	{MID}var~offset~count~ (get substring)

0x0FC	0x18	{NEST}file~ (execute now)

0x0FC	0x19	{NEXT} (loop in while, for, for each)

0x0FC	0x37	{NTOK}value~ (convert number to key)

0x0FC	0x1B	{ON CANCEL}action~ ~(continue), {QUIT}~, {RETURN}~, {GO}label~, {CALL}label

0x0FC	0x1C	{ON ERROR}action~ ~(continue), {QUIT}~, {RETURN}~, {GO}label~, {CALL}label~

0x0FC	0x1D	{ON NOT FOUND}action~ ~(continue), {QUIT}~, {RETURN}~, {GO}label~, {CALL}label~

0x0FC	0x2E	{ORIGINAL KEY} (original keyboard contents of last key entered) Character Version Only

0x080	0x64	{Para Down}

0x080	0x63	{Para Up}

0x0FC	0x1E	{PAUSE} (unprompted user input)

0x0FC	0x3B	{PAUSE KEY}key~

0x0FC	0x1F	{PROMPT}message~ (prompt on bottom line)

0x0FC	0x20	{QUIT} (stop all macro execution)

0x0FC	0x21	{RESTART} (quit after current level)

0x0FC	0x22	{RETURN} (leave current execution level)

0x0FC	0x23	{RETURN CANCEL}

0x0FC	0x24	{RETURN ERROR}

0x0FC	0x25	{RETURN NOT FOUND}

0x0FC	0x1A	{SHELL MACRO}name~ (execute a shell macro) Character Version Only

0x0FC	0x26	{SPEED}100ths~ (time to wait between each char)

0x0FC	0x29	{STATE} (get value of the state variable)

0x0FC	0x32	{STATUS PROMPT}message~ (message for status line) Character Version Only

0x0FC	0x2D	{STEP OFF} (turn off single step)

0x0FC	0x27	{STEP ON} (turn on single step)

0x0FC	0x35	†	{SYSTEM}systemvar~ (reference system data)

0x0FC	0x28	{TEXT}var~message~ (assign string to the var)

0x0FC	0x34	{VARIABLE}var~ (reference variable contents)

0x0FC	0x2A	{WAIT}10ths~ (time for single delay)

0x0FC	0x2B	{WHILE}value~ (while !0 loop END WHILE)

†	If the cursor rests on a function code, the macro command and {SYSTEM}right~ subcommand return the first two bytes of that function code.

Display Control Characters (Character Version Only)

In the character version, the {PROMPT} and {CHAR} commands listed above in the keyboard macro commands accept a message as their input. The message can contain the following display control characters to position the message on the screen and turn On/Off screen attributes.

Code	Meaning

0x7	Bell

0x8	Home—position to upper left corner of screen

0x9	Reserved

0x0A	New line

0x0B	Clear to end of line

0x0C	Clear screen, go home

0x0D	Carriage return

0x0E	Attributes on—followed by one of these attribute indicators:

0x0	=	Extra Large

0x1	=	Very Large

0x2	=	Large

0x3	=	Small

0x4	=	Fine

0x5	=	Superscript

0x6	=	Subscript

0x7	=	Outline

0x8	=	Italics

0x9	=	Shadow

0x0A	=	Redline

0x0B	=	Double Underline

0x0C	=	Bold

0x0D	=	Strikeout

0x0E	=	Underline

0x0F	=	Small Caps

0x10	=	Blink

0x11	=	Reverse Video

0x0FF	=	all attributes when used after attributes are off

0x0F	Attributes are Off (followed by one of the attribute indicators above)

0x10	Position (followed by column, then row: one byte each)

0x11	Clear All Attributes

0x12	Reverse Video On

0x13	Reverse Video Off

0x14	Underline On

0x15	Underline Off

0x16	Mnemonic Attribute (the next character only)

0x17	Up

Code	Meaning

0x18	Right

0x19	Left

0x1A	Down

0x1B	Escape

0x1C	Bold Off

0x1D	Bold On

0x0FF	Do not interpret the following character

Tokens and Their Parameter Formats

Token Name:	WCONDENSE

High Byte Value:	0x20

Low Byte Value:	0x01

Description:	Condense Master Document

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 1)

Byte 2	Prompt flag:

=	2	don't save subdocuments

=	3	save subdocuments, don't prompt before overwriting

=	4	save subdocuments, prompt before overwriting

Token Name:	WDOCCMP

High Byte Value:	0x20

Low Byte Value:	0x02

Description:	Compare Documents

Structure:	Data	Meaning

Bytes 0–1	Length of data following (variable) Byte 2–n
Filename to compare current document to (null terminated)

Token Name:	WMRKFTOA

High Byte Value:	0x20

Low Byte Value:	0x03

Description:	Mark Full Table of Authorities Entry

Structure:	Data	Meaning

Bytes 0–1	Length of data following (variable length)

Byte 2	ToA level # (1–16)

Bytes 4–n	Short form string (not null terminated)

Token Name:	WMRKSTOA

High Byte Value:	0x20

Low Byte Value:	0x04

Description:	Mark Short Table of Authorities Entry

Structure:	Data	Meaning

Bytes 0–1	Length of data following (variable)

Bytes 2–n	Short form string (null terminated)

Token Name:	WMRKXREF

High Byte Value:	0x20

Low Byte Value:	0x05

Description:	Mark Text for Cross-Reference

Structure:	Data	Meaning

Bytes 0–1	Length of data following (variable)

Byte 2	What to mark:

= 1 Mark Reference only

= 2 Mark Target only

= 3 Mark both Reference and Target

Byte 3	Tie Reference to flag:

= 0 tie to page

= 1 tie to Paragraph

= 2 tie to Footnote

= 3 tie to Endnote

= 4 tie to Figure

= 5 tie to Table Box

= 6 tie to Text Box

= 7 tie to User Box

= 8 tie to Equation Box

Bytes 4–n	Target name (null terminated)

Token Name:	WMRKLST

High Byte Value:	0x20

Low Byte Value:	0x06

Description:	Mark Text for a List

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 1)

Byte 2	List #:

= 1 User-defined List 1

= 2 User-defined List 2

= 3 User-defined List 3

= 4 User-defined List 4

= 5 User-defined List 5

= 6 Figure Captions List

= 7 Table Captions List

= 8 Text Box Captions List

= 9 User Box Captions List

= 10 Equation Box Captions List

Token Name:	WMRKINDX

High Byte Value:	0x20

Low Byte Value:	0x07

Description:	Mark Text for an Index

Structure:	Data	Meaning

Bytes 0–1	Length of data following (variable length)

Bytes 2–n	Index heading string (null terminated)

Bytes n+1–m	Index subheading string (null terminated)

Token Name:	WMRKTOC

High Byte Value:	0x20

Low Byte Value:	0x08

Description:	Mark Text for Table of Contents

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 1)

Byte 2	Table of contents level # (1–5)

Token Name:	WRMVRED

High Byte Value:	0x20

Low Byte Value:	0x09

Description:	Remove Redline Marks

Structure:	Data	Meaning

No associated data

Token Name:	WSUBDOC

High Byte Value:	0x20

Low Byte Value:	0x0A

Description:	Create Subdocument

Structure:	Data	Meaning

Bytes 0–1	Length of data following (variable)

Byte 2–n	Subdocument filename (not null terminated)

Token Name:	WTYPESET

High Byte Value:	0x20

Low Byte Value:	0x0B

Description:	Typesetting Features

Structure:	Data	Meaning

Bytes 0–1	Length of data following (range = 1–17 bytes)

Byte 2	Values Changed flag:

= 1 word/letter spacing

= 2 word spacing justification limits

= 4 Line Height adjustment

= 8 Underline

Data	Meaning

= 16 Baseline

= 32 Kerning

Bytes 3–4	Character width adjustment (word value)

Bytes 5–6	Space width adjustment (word value)

Bytes 7–8	Minimum word spacing justification (word value, min range = 0–100)

Bytes 9–10	Maximum word spacing justification (word value, max range = 100–1000)

Bytes 11–12	Line Height between lines (soft return) (word value in wpu)

Bytes 13–14	Line Height between paragraphs (hard return) (word value in wpu)

Byte 15	Underlining and Baseline:

bit 1 = Underline spaces, set or unset

bit 2 = Underline tabs, set or unset

bit 5 = Baseline, set or unset

Byte 16	Kerning:

bit 1 = set or unset

Token Name:	WINSPCMD

High Byte Value:	0x20

Low Byte Value:	0x0C

Description:	Insert Printer Command

Structure:	Data	Meaning

Bytes 0–1	Length of data following (variable)

Byte 2	Type of command:

= 0 command string

= 1 filename

Bytes 3–n	Command string or filename

Token Name:	WMANKERN

High Byte Value:	0x20

Low Byte Value:	0x0D

Description:	Manual Kerning

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 3)

Byte 2	Direction of kern (advance direction)

= 4 advance left

= 5 advance right

Bytes 3–4	Advance value

Token Name:	WCOLMNDEF

High Byte Value:	0x20

Low Byte Value:	0x0E

Description:	Columns Define

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always = 25 * 2 * 2 * 2 + 3)

Byte 2	Columns on flag:

= 1 define columns and turn columns on (if necessary)

= 0 define columns only

Bytes 3–99	Reserved (set to 0)

Byte 100	# of columns:

bits 0–4 = # of columns (2–24)

bit 5 = reserved

bit 6 = 1 parallel columns

bit 7 = 1 parallel columns with block protect

Bytes 101–196	Column left/right margins (in wpu) (2 byte values, intel order)

101–102	left margin of first column

103–104	right margin of first column

105–106	left margin of second column, and so forth set unused fields to 0xFFFF)

Bytes 197–204	(set to 0xFF)

Token Name:	WMACADD

High Byte Value:	0x20

Low Byte Value:	0x0F

Description:	Add Macro to Menu

Structure:	Data	Meaning

Bytes 0–1	Length of data following (length of macro file name plus null)

Bytes 2–?	Macro file name (full path, null terminated)

Token Name:	WMACDEL

High Byte Value:	0x20

Low Byte Value:	0x10

Description:	Delete Macro from Menu

Structure:	Data	Meaning

Bytes 0–1	Length of data following (count + data)

Byte 2–3	Count = # of macros to delete from menu

Bytes 4–?	Size-count array of macro file names (160 bytes per filename)

Token Name:	WDOCSUM

High Byte Value:	0x20

Low Byte Value:	0x11

Description:	Document Summary

Structure:	Data	Meaning

Bytes 0–1	Length of data following	(always 1514)

Note: The following are all null-terminated strings.

Bytes 2–71	Descriptive name (70 bytes)

Bytes 72–92	Descriptive type	(21 bytes)

Bytes 93–118	Creation date (text form—26 bytes)

Bytes 119–179	Author (61 bytes)

Bytes 180–240	Typist (61 bytes)

Bytes 241–401	Subject (161 bytes)

Bytes 402–562	Account (161 bytes)

Bytes 563–723	Keywords (161 bytes)

Bytes 724–1504	Abstract (781 bytes)

Bytes 1505–1516	Extra (used internally)

Token Name:	WSPREADIMPORT

High Byte Value:	0x20

Low Byte Value:	0x13

Description:	Import Spreadsheet

Structure:	Data	Meaning

Bytes 0–1	Length of data following

Bytes 2–3	Length of spreadsheet name

Bytes 4–?	Spreadsheet name

2 Bytes	Length of range name

2 Bytes	Length of cell range

2 Bytes	Display as table or text (padded with NULL)

Token Name:	WSPREADCREATE

High Byte Value:	0x20

Low Byte Value:	0x14

Description:	Create Spreadsheet Link

Structure:	Data	Meaning

Bytes 0–1	Length of data following

Bytes 2–3	Length of spreadsheet name

Bytes 4–?	Spreadsheet name

2 Bytes	Length of range name

2 Bytes	Length of cell range

2 Bytes	Display as table or text (padded with NULL)

Token Name:	WSPREADEDIT

High Byte Value:	0x20

Low Byte Value:	0x15

Description:	Edit Spreadsheet Link

Structure:	Data	Meaning

Bytes 0–1	Length of data following

Bytes 2–3	Length of spreadsheet name

Bytes 4–?	Spreadsheet name

2 Bytes	Length of range name

2 Bytes	Length of cell range

2 Bytes	Display as table or text (padded with NULL)

Token Name:	WSPREADUPDATE

High Byte Value:	0x20

Low Byte Value:	0x16

Description:	Update Spreadsheet Links

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 0 and padded with NULL)

Token Name:	WSPREADLINK

High Byte Value:	0x20

Low Byte Value:	0x17

Description:	Spreadsheet Link Options

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 4)

Bytes 2–3	Update on retrieve

Bytes 4–5	Show link codes

Token Name:	WGENERATE

High Byte Value:	0x20

Low Byte Value:	0x18

Description:	Generate

Structure:	Data

No associated data

Token Name:	WAPPEND

High Byte Value:	0x20

Low Byte Value:	0x19

Description:	Append Block To File

Structure:	Data	Meaning

Bytes 0–1	Length of filename + 1

Bytes 2–?	Filename and null terminator

Token Name:	WLNSPC

High Byte Value:	0x20

Low Byte Value:	0x1C

Description:	Line Spacing

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 2)

Bytes 2–3	Spacing value (low byte is 1/256 of line, high byte is whole lines, then swap)

Token Name:	WLNHGT

High Byte Value:	0x20

Low Byte Value:	0x1D

Description:	Line Height

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 2)

Byte 2–3	New line height in wpu (if value is 0, auto line height)

Token Name:	WLNNUM

High Byte Value:	0x20

Low Byte Value:	0x1E

Description:	Line Numbering

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 5)

Byte 2	Interval:

bit 7 = 1 line numbering ON

bit 6 = 1 # only text line ON

bit 5 = 1 restart numbering on each page ON

bits 0–4 = line numbering interval (1–30)

Byte 3–4	Position (distance from left edge of paper to right edge of line # in wpu)

Byte 5–6	Starting #

Token Name:	WLNHYP

High Byte Value:	0x20

Low Byte Value:	0x1F

Description:	Hyphenation

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 3)

Byte 2	†	Left hyphenation-zone percentage

Byte 3	†	Right hyphenation-zone percentage

Byte 4	Enable hyphenation (1 = On)

†	Percentage bytes are binary fractions that are converted to a percentage. A value of 64 would be 25%, since 64/256 = .25.

Token Name:	WCAN

High Byte Value:	0x20

Low Byte Value:	0x20

Description:	Undelete

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 1)

Byte 2	Undelete level (0–8) (0 = most recent deletion)

Token Name:	WFS

High Byte Value:	0x20

Low Byte Value:	0x21

Description:	Forward Search

Structure:	Data	Meaning

Bytes 0–1	Length of data following

Byte 2	Forward search (always 0)

Byte 3	= 0 regular search; = 1 extended search

Byte 4	(always 3)

Bytes 5–6	Search string length

Bytes 7–n	Search string

Token Name:	WHELP

High Byte Value:	0x20

Low Byte Value:	0x22

Description:	Reference Help

Structure:	Data	Meaning

Bytes 0–1	Length of data (2 bytes)

Bytes 2–3	Length of filename (2 bytes)

Bytes 4–?	Filename (NOT null terminated — variable length)

Bytes ?	Length of topic name (2 bytes)

..	Topic name (NOT null terminated — variable length)

..	Search flag (2 bytes):

..	= 0 search for "HELP" comment

..	= 1 search for "HOW" comment

..	Display flag (2 bytes):

= 0 help reference file (search for help/how comment)

= 1 special help document (do not search for topic name)

Token Name:	WLANG

High Byte Value:	0x20

Low Byte Value:	0x23

Description:	Set Language

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 2)

Bytes 2–3	Two-letter language code

Token Name:	WEXR

High Byte Value:	0x20

Low Byte Value:	0x26

Description:	Exit Current Document

Structure:	Data

None

Token Name:	WBTNRET

High Byte Value:	0x20

Low Byte Value:	0x27

Description:	Retrieve Button Bar

Structure:	Data	Meaning

Bytes 0–1	Length of filename + 1

Bytes 2–?	Filename and null terminator

Token Name:	WSTYOFF

High Byte Value:	0x20

Low Byte Value:	0x2A

Description:	Turn Style Off

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 4)

Bytes 2–5	Index into style list (int)

Token Name:	WSTYON

High Byte Value:	0x20

Low Byte Value:	0x2B

Description:	Turn Style On

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 4)

Bytes 2–5	Index into style list (int)

Token Name:	WBS

High Byte Value:	0x20

Low Byte Value:	0x2D

Description:	Backward Search

Structure:	Data	Meaning

Bytes 0–1	Length of data following

Byte 2	Backward search (always 1)

Byte 3	= 0 regular search; = 1 extended search

Byte 4	(always 3)

Bytes 5–6	Search string length

Bytes 7–n	Search string

Token Name:	WDCSW

High Byte Value:	0x20

Low Byte Value:	0x2E

Description:	Switch/Create Document

Structure:	Data	Meaning

Byte 0	Document # 0–8

Token Name:	WMRCM

High Byte Value:	0x20

Low Byte Value:	0x34

Description:	Insert a Merge Command Function in the Document

Structure:	Data	Meaning

Bytes 0–1	Length of data following

Byte 2	Merge command (0x20 through 0x64)

Bytes 3–?	Parameter for the command (that is, "var~1~" in {ASSIGN}var~1~) (there is nothing there if this merge command has no parameters)

Note:	The merge codes are listed in the File Format Section of the WP 5.1 Toolkit. Look at the "Variable-Length Multi-byte Function" section under function 0xDE.

Token Name:	WIN

High Byte Value:	0x20

Low Byte Value:	0x35

Description:	Retrieve File

Structure:	Data	Meaning

Bytes 0–1	Length of filename

Bytes 2–?	Filename to retrieve

Token Name:	WSAR

High Byte Value:	0x20

Low Byte Value:	0x39

Description:	Search and Replace

Structure:	Data	Meaning

Bytes 0–1	Length of data following

Byte 2	= 0 forward replace; = 1 backward replace

Byte 3	= 0 regular replace; = 1 extended replace

Byte 4	= 1 replace all; = 2 replace once (first occurrence)

Bytes 5–6	Search string length

Bytes 7–n	Search string Bytes n+1–n+2 Replace string length

Bytes n+3–?	Dialog box replace string

Token Name:	WDFLIST

High Byte Value:	0x20

Low Byte Value:	0x3A

Description:	Define a List

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 2)

Byte 2	List type:

= 1 User-defined List 1

= 2 User-defined List 2

= 3 User-defined List 3

= 4 User-defined List 4

= 5 User-defined List 5

= 6 Figure Captions List

= 7 Table Captions List

= 8 Text Box Captions List

= 9 User Box Captions List

= 10 Equation Box Captions List

Byte 3	Page Numbering format:

= 0 no #s

= 1 #s immediately follow text

= 2 #s immediately follow text in parentheses

= 3 #s right justified

= 4 #s right justified with dot leaders

Token Name:	WDFINDEX

High Byte Value:	0x20

Low Byte Value:	0x3B

Description:	Define an Index

Structure:	Data	Meaning

Bytes 0–1	Length of data following (1 or variable)

Structure:	Data	Meaning

Byte 2	Page Numbering format:

= 0 no #s

= 1 #s immediately follow text

= 2 #s immediately follow text in parentheses

= 3 #s right justified

= 4 #s right justified with dot leaders

Bytes 3–n	(Optional) Concordance filename (null terminated)

Token Name:	WDFTOC

High Byte Value:	0x20

Low Byte Value:	0x3C

Description:	Define a Table of Contents

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 7)

Byte 2	# of levels in the table (1–5)

Byte 3	Wrap last level:

= 0	don't wrap last level

= 1	wrap last level

Bytes 4–8	Page Numbering format for levels 1–5:

= 0	no page #s

= 1	Page # after text, preceded by two spaces

= 2	Page # after text, in parentheses, preceded by one space

= 3	Page # flush right

= 4	Page # flush right with dot leader

Token Name:	WDFTOA

High Byte Value:	0x20

Low Byte Value:	0x3D

Description:	Define a Table of Authorities

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 2)

Byte 2	Format bit flags (xxxBxxDU)

B: = 1 insert blank line between authorities

D: = 1 dot leader before page #s

U: = 1 underlining permitted

Byte 3	Level # (1–16)

Token Name:	WMTCL

High Byte Value:	0x80

Low Byte Value:	0x3E

Description:	Math

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 104)

Bytes 2–106	cldef math define information

Token Name:	WINB

High Byte Value:	0x20

Low Byte Value:	0x41

Description:	Macro Execute

Structure:	Data	Meaning

Bytes 0–1	Length of data following (macro file name plus null)

Bytes 2–?	Macro file name (full path) null terminated

Token Name:	WSORT

High Byte Value:	0x20

Low Byte Value:	0x4C

Description:	Sort

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 761)

Bytes 2–11	Key 1 field string

Bytes 12–21	Key 1 line string

Bytes 22–31	Key 1 word string

Byte 32	Key 1 type:

= 0 alphanumeric

= 1 numeric

Bytes 33–42	Key 2 field string

Bytes 43–52	Key 2 line string

Bytes 53–62	Key 2 word string

Byte 63	Key 2 type

..

..

Bytes 250–259	Key 9 field string

Bytes 260–269	Key 9 line string

Bytes 270–279	Key 9 word string

Byte 280	Key 9 type

Byte 281	Record type:

= 0 line

= 1 paragraph

= 2 merge

= 3 table

Structure:	Data	Meaning

Byte 282	Sort order:

= 0 ascending

= 1 descending

Bytes 283–442	Selection string

Bytes 443–602	Sort input filename

Bytes 603–762	Sort output filename

Token Name:	WSEPART

High Byte Value:	0x20

Low Byte Value:	0x52

Description:	Define Separators (Decimal Align and Thousands)

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 12)

Bytes 2–3	(set to 0)

Bytes 4–5	Alignment character (character #, character set)

Bytes 6–7	Separator character (character #, character set)

Bytes 8–13	(set to 0xFF)

Token Name:	TABLOPT

High Byte Value:	0x20

Low Byte Value:	0x54

Description:	Table Options

Structure:	Data	Meaning

Bytes 0–1	Length of data following (either 18 or 20)

Bytes 2–3	# of columns in table

Bytes 4–5	# of rows in table

Bytes 6–7	Left margin size in wpu

Bytes 8–9	Right margin size in wpu

Bytes 10–11	Top margin size in wpu

Bytes 12–13	Bottom margin size in wpu

Byte 14	Negative value method (1 = 'þ', 2 = '()')

Byte 15–16	# of header rows

Byte 17	Shading value (0–100)

Byte 18	Table position (= 1 Left, = 2 Right, = 3 Center, = 4 Full, = 5 From Left edge) (if Byte 18 == 5, two bytes follow) (distance from Left edge in wpu)

Byte 19 or 21	Cell Lock (True = 1, False = 0) Override all cell locking if false.

Token Name:	WZOOMCHANGE

High Byte Value:	0x20

Low Byte Value:	0x55

Description:	Set Zoom Value

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 2)

Byte 2	If 0, size is in byte 3; if 1, fit to current page size

Byte 3	Zoom percent if byte 2 is 0

Token Name:	TABLSPLT

High Byte Value:	0x20

Low Byte Value:	0x56

Description:	Split Cells

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 3)

Byte 2	= 0 for row, = 1 for column

Bytes 3–4	# of rows/columns to split (must be > 1)

Token Name:	TABLINS

High Byte Value:	0x20

Low Byte Value:	0x57

Description:	Table Insert Row or Column

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 3)

Byte 2	= 0 for row, = 1 for column

Bytes 3–4	# of rows/columns to split

Token Name:	WGO

High Byte Value:	0x20

Low Byte Value:	0x58

Description:	Goto

Structure:	Data	Meaning

Bytes 0–1	Length of data following (varies)

Byte 2	Position to go to:

= 0 page # The following are used when in tables:

= 1 cell location (such as A1)

= 2 first cell

= 3 last cell

= 4 top of column

= 5 bottom of column

= 6 first column

Bytes 3–4	Goto page #

Bytes 3–?	Goto cell location string (null terminated)

Other bytes: No data

Token Name:	WFGBOXRET

High Byte Value:	0x20

Low Byte Value:	0x59

Description:	Insert a Figure Into the Document

Structure:	Data	Meaning

Bytes 0–1	Length of following data (variable)

Bytes 2–?	Name of graphic to insert (includes the path)

Token Name:	WFGBOXCRT

High Byte Value:	0x20

Low Byte Value:	0x5A

Description:	Create a Figure Box

Structure:	Data	Meaning

Bytes 0–1	Length of following data (variable)

Bytes 2–5	Flags indicating which default box values to modify

bit 0 = 0 use default figure values, = 1 use modified values,

indicated by the following flags:

bit 1 reserved

bit 2 must be 0 (used internally)

bit 3 =	1 tells macro to place box in the specified position

bit 4 =	1 box type is changed according to byte 9

bit 5 =	1 anchor type

bit 6 =	1 vertical position option

bit 7 =	1 horizontal position option

bit 8 =	1 aligned with option

bit 9 =	1 height sizing mode

bit 10 =	1 width sizing mode

bit 11 =	1 text wrap mode

bit 12 =	1 horizontal position

bit 13 =	1 vertical position

bit 14 =	1 mirror figure

bit 15 =	1 invert figure

bit 16 =	1 black and white figure

bit 17 =	1 rotate figure

bit 18 =	1 scale in X

bit 19 =	1 scale in Y

bit 20 =	1 move in X

bit 21 =	1 move in Y

bit 22 =	0 create an empty graphic box

=	1 create a box with a graphic in it

bit 23 =	1 read in a file

bit 24 =	1 width

Structure:	Data	Meaning

bit 25 =	1 height

bit 26 =	1 graphic not in default path

bit 27 (not used for graphics)

Bytes 6–7	Box # (not used for creating a graphic)

Byte 8	Editor to use to create box (defines contents of box)

= 128 graphic editor

Byte 9	The box type:

= 0 Figure Box

= 1 Table Box

= 2 Text Box

= 3 User-defined Box

= 4 Equation Box

Bytes 10–127	Bytes 4 through 121 of box function (see the WordPerfect section of the Toolkit for Box Group (0xDA)). Modify those values that are to be changed from the default as indicated in bytes 2 to 5.

Bytes 128–?	Variable (caption text, if any)

4 Bytes Reserved

Variable	Filename (include a file name only if flag bit 23 is set. Include the full path if file is not in the default graphics path, indicated by flag bit 26).

Note:	In addition, see tokens WTBBOXCRT, WUSBOXCRT, and WEQBOXCRT later in this section.

Token Name:	WFGBOXEDIT

High Byte Value:	0x20

Low Byte Value:	0x5B

Description:	Edit a Figure Box

Structure:	Data	Meaning

Bytes 0–1	Length of following data (variable)

Bytes 2–5	Flags indicating which box values to modify:

bit 0 must be 1

bit 1 reserved

bit 2 must be 0 (used internally)

bit 3 = 1 tells macro to place box in the specified position

bit 4 = 1 box type will be changed according to byte 9

bit 5 = 1 anchor type

bit 6 = 1 vertical position option

bit 7 = 1 horizontal position option

bit 8 = 1 aligned with option

bit 9 = 1 height sizing mode

bit 10 = 1 width sizing mode

Structure:	Data	Meaning

bit 11 = 1 text wrap mode

bit 12 = 1 horizontal position

bit 13 = 1 vertical position

bit 14 = 1 mirror figure

bit 15 = 1 invert figure

bit 16 = 1 black and white figure

bit 17 = 1 rotate figure

bit 18 = 1 scale in X

bit 19 = 1 scale in Y

bit 20 = 1 move in X

bit 21 = 1 move in Y

bit 22 must be 0 for editing

bit 23 = 1 read in a file

bit 24 = 1 width bit 25 = 1 height

bit 26 = 1 graphic not in default path

bit 27 (not used for graphics)

Bytes 6–7	Box #:

bits 5–15 = first level #

bits 0–4 = second level #

Byte 8	Editor to use to create box (defines contents of box):

= 128 graphic

= 16 text

= 8 equation

Byte 9	The box type:

= 0 Figure Box

= 1 Table Box

= 2 Text Box

= 3 User-defined Box

= 4 Equation Box

Bytes 10–127	Bytes 4 through 121 of box function (see the WordPerfect section of the Toolkit for Box Group (0xDA)). Modify those values that are to be changed from the default as indicated in bytes 2–5.

Bytes 128–?	Variable (caption text, if any)

4 Bytes	Reserved

Variable	Filename (Include a file name if flag bit 23 is set. Include full path if file is not in the default graphics path, indicated by flag bit 26).

Note:	In addition, see tokens WTBBOXEDIT, WTXBOXEDIT, WUSBOXEDIT, and WEQBOXEDIT later in this section.

Token Name:	WFGBOXPOS

High Byte Value:	0x20

Low Byte Value:	0x5C

Description:	Edit a Figure Box Position

Structure:	Data	Meaning

Bytes 0–1	Length of data following (variable)

Bytes 2–3	Flags indicating which position values to change:

bit 1 = 1 change the box type

bit 2 = 1 change the vertical position option

bit 3 = 1 change the vertical position

bit 4 = 1 change the horizontal position option

bit 5 = 1 change the horizontal position

bit 6 = 1 change the anchor type

bit 7 = 1 change the # of pages to skip

bit 8 = 1 change sizing mode

bit 9 = 1 change the width

bit 10 = 1 change the height

bit 11 = 1 change text wrap

Bytes 4–5	Box # (not used if calling state (byte 6) = 2):

bits 5–15 = first level #

bits 0–4 = second level #

Byte 6	Calling state flag:

=	1 Box Position is being called from the main document

= 2 Box Position is being called from one of the editors

Bytes (variable)	Include only the values that you want to change (indicated in flag bytes 2–3) from this point on. The relative ordering must remain as listed below (vertical position must always follow anchor type and must precede horizontal position).

1 byte	Box Type:

= 0 Figure Box

= 1 Table Box

= 2 Text Box

= 3 User-defined Box

= 4 Equation Box

1 byte	Anchor Type:

= 0 anchored to paragraph

= 1 anchored to page

= 2 anchored to character

1 byte	# of pages to skip (only applies when anchor type is page)

Structure:	Data	Meaning

1 byte	Vertical Position Option:

bits 0–1 = reserved

bits 2–4:

= 0 full page

= 1 top

= 2 middle

= 3 bottom

= 4 absolute

bits 5–7 = reserved

2 bytes	Vertical Position in wpu

1 byte	Horizontal Position Option:

bits 0–1 = alignment option

= 0 left

= 1 right

= 2 centered

= 3 full page (left and right)

bits 2–3 = aligned with

= 0 margin

= 1 columns

= 2 absolute

2 bytes	Horizontal Position (If horizontal position option is column aligned, first byte = column # and second byte specifies a range of columns. Second byte must equal the first byte if no range is desired)

1 byte	Size mode:

bits 0–3 = reserved

bit 4 = 0 scale height to figure, = 1 fixed width

bit 5 = 0 scale width to figure, = 1 fixed height

bits 6–7 = reserved

2 bytes	Width of box in wpu

2 bytes	Height of box in wpu

1 byte	Text wrap state:

bits 0–6 = reserved

bit 7 = 0 wrap text around box, = 1 don't wrap text around box

Note:	In addition, see tokens WTBBOXPOS, WTXBOXPOS, WUSBOXPOS, and WEQBOXPOS later in this section.

Token Name:	WFGBOXCAPT

High Byte Value:	0x20

Low Byte Value:	0x5D

Description:	Edit a Figure Box Caption

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 2)

Bytes 2–3	Box #:

bits 5–15 = first level #

bits 0–4 = second level #

Token Name:	WFGBOXNWNM

High Byte Value:	0x20

Low Byte Value:	0x5E

Description:	Set Box Number for Figure Boxes

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 2)

Bytes 2–3	New box #:

bits 5–15 = first level #

bits 0–4 = second level #

Token Name:	WFGBOXOPT

High Byte Value:	0x20

Low Byte Value:	0x5F

Description:	Figure Box Options

Structure:	Data	Meaning

Bytes 0–1	Length of following data (always 42)

Byte 2	Bits 0–1 = numbering style for level 1 box #

= 1 use #s

= 2 use upper2

= 3 use uppercase roman numerals

Bits 2–3 = numbering style for level 2 box #

= 0 this level not used

= 1 use #s = 2 use lowercase letters

= 3 use lowercase roman numerals

Bit 4 = caption position (below/above)

=	0 position caption below window (or left centered for equations if inside)

=	1 position caption above window (or right centered for equations if inside)

bit 5: caption position (outside/inside)

=	0 position caption outside borders (above or below for equations)

Structure:	Data	Meaning

=	1 position caption inside windows (for equations, signals left or right)

Byte 3	Shading % (0–100%; = 0 don't shade)

Bytes 4–5	Border styles (4 bits each: Left, Right, Top, Bottom) (high to low):

= 0 none

= 1 single

= 2 double

= 3 dashed

= 4 dotted

= 5 thick

= 6 extra thick

= 7 not used

Bytes 6–7	Minimum offset from start of paragraph in wpu

Bytes 8–15	Spacing between border and text in wpu (one word each for left, right, top, and bottom, respectively)

Bytes 16–23	Spacing between border and figure (one word each for left, right, top, and bottom, respectively)

Bytes 23–42	String for box # in captions

Note:	In addition, see tokens WTBBOXOPT, WTXBOXOPT, WUSBOXOPT, and WEQBOXOPT later in this section.

Token Name:	WTXBOXEDIT

High Byte Value:	0x20

Low Byte Value:	0x61

Description:	Edit a Text Box

Structure:	(See Token WFGBOXEDIT earlier in this section)

Token Name:	WTXBOXPOS

High Byte Value:	0x20

Low Byte Value:	0x62

Description:	Edit a Text Box Position

Structure:	(See Token WFGBOXPOS earlier in this section)

Token Name:	WTXBOXCAPT

High Byte Value:	0x20

Low Byte Value:	0x63

Description:	Edit a Text Box Caption

Structure:	(See Token WFGBOXCAPT earlier in this section)

Token Name:	WTXBOXNWNM

High Byte Value:	0x20

Low Byte Value:	0x64

Description:	Set Box Number for Text Boxes

Structure:	(See Token WFGBOXNWNM earlier in this section)

Token Name:	WTXBOXOPT

High Byte Value:	0x20

Low Byte Value:	0x65

Description:	Text Box Options

Structure:	(See Token WFGBOXOPT earlier in this section)

Token Name:	WTEXTROT

High Byte Value:	0x20

Low Byte Value:	0x66

Description:	Rotate a Box Containing Text (this token is only valid when called from within)

Structure:	Data	Meaning

Bytes 0–1	Length of data following (always 2)

Bytes 2–3	Rotation values (0, 90, 180, or 270þ)

Token Name:	WEQBOXCRT

High Byte Value:	0x20

Low Byte Value:	0x67

Description:	Create an Equation Box

Structure:	(See Token WFGBOXCRT earlier in this section)

Token Name:	WEQBOXEDIT

High Byte Value:	0x20

Low Byte Value:	0x68

Description:	Edit an Equation Box

Structure:	(See Token WFGBOXEDIT earlier in this section)

Token Name:	WEQBOXPOS

High Byte Value:	0x20

Low Byte Value:	0x69

Description:	Edit an Equation Box Position

Structure:	(See Token WFGBOXPOS earlier in this section)

Token Name:	WEQBOXCAPT

High Byte Value:	0x20

Low Byte Value:	0x6A

Description:	Edit an Equation Box Caption

Structure:	(See Token WFGBOXCAPT earlier in this section)

Token Name:	WEQBOXNWNM

High Byte Value:	0x20

Low Byte Value:	0x6B

Description:	Set Box Number for Equation Boxes

Structure:	(See Token WFGBOXNWNM earlier in this section)

Token Name:	WEQBOXOPT

High Byte Value:	0x20

Low Byte Value:	0x6C

Description:	Equation Box Options

Structure:	(See Token WFGBOXOPT earlier in this section)

Token Name:	WTBBOXCRT

High Byte Value:	0x20

Low Byte Value:	0x6D

Description:	Create a Table Box

Structure:	(See Token WFGBOXCRT earlier in this section)

Token Name:	WTBBOXEDIT

High Byte Value:	0x20

Low Byte Value:	0x6E

Description:	Edit a Table Box

Structure:	(See Token WFGBOXEDIT earlier in this section)

Token Name:	WTBBOXPOS

High Byte Value:	0x20

Low Byte Value:	0x6F

Description:	Edit a Table Box Position

Structure:	(See Token WFGBOXPOS earlier in this section)

Token Name:	WTBBOXCAPT

High Byte Value:	0x20

Low Byte Value:	0x70

Description:	Edit a Table Box Caption

Structure:	(See Token WFGBOXCAPT earlier in this section)

Token Name:	WTBBOXNWNM

High Byte Value:	0x20

Low Byte Value:	0x71

Description:	Set Box Number for Table Boxes

Structure:	(See Token WFGBOXNWNM earlier in this section)

Token Name:	WTBBOXOPT

High Byte Value:	0x20

Low Byte Value:	0x72

Description:	Table Box Options

Structure:	(See Token WFGBOXOPT earlier in this section)

Token Name:	WUSBOXCRT

High Byte Value:	0x20

Low Byte Value:	0x73

Description:	Create a User-Defined Box

Structure:	(See Token WFGBOXCRT earlier in this section)

Token Name:	WUSBOXEDIT

High Byte Value:	0x20

Low Byte Value:	0x74

Description:	Edit a User-Defined Box

Structure:	(See Token WFGBOXEDIT earlier in this section)

Token Name:	WUSBOXPOS

High Byte Value:	0x20

Low Byte Value:	0x75

Description:	Edit a User-Defined Box Position

Structure:	(See Token WFGBOXPOS earlier in this section)

Token Name:	WUSBOXCAPT

High Byte Value:	0x20

Low Byte Value:	0x76

Description:	Edit a User-Defined Box Caption

Structure:	(See Token WFGBOXCAPT earlier in this section)

Token Name:	WUSBOX

High Byte Value:	0x20

Low Byte Value:	0x77

Description:	Set Box Number for User-Defined Boxes

Structure:	(See Token WFGBOXNWNM earlier in this section)

Token Name:	WUSBOXOPT

High Byte Value:	0x20

Low Byte Value:	0x78

Description:	User-Defined Box Options

Structure:	(See Token WFGBOXOPT earlier in this section)

Token Name:	WOVRSTKC

High Byte Value:	0x20

Low Byte Value:	0x7B

Description:	Overstrike Create

Structure:	Data	Meaning

Bytes 0–1	Length of data following (variable)

Bytes 2–?	String of characters to overstrike (may contain extended characters and attributes)