# opcode

> [HTML Version](opcodextext.htm)

_Opcode_  determines the operational mode. 

| **Symbol** | **Value** | **Description** |
|------|------|------|
| TXOP\_CREATE | 1 | This is the only operation you really need. It starts by creating a new text editing control or re-using an existing one, based on the [TXC.CTLNO](txtctl2.md#txc.ctlno) field of the _[txtctl](txtctl.md)_ parameter, which see for details. The control is then loaded with text, based on the [src](srcxtext.md) parameter and [TXC.DOCFMT'SRC](txc_docfmt-src.md) field of the _txtctl_ parameter. In this, the "normal" usage mode, a single XCALL XTEXT causes the control object to be created and loaded with data. (If the _src_ parameter is empty, the new control starts out empty.) The focus is then put on the control, where the user can perform text editing operations until some kind of exit key or event is triggered. At that point, unless the TXF\_DEFERSAVE flag is specified, the contents of the control are returned to the application via the [dst](dstxtext.md) parameter. Finally, unless the TXF\_MODELESS flag is specified, the control is deleted. |
| TXOP\_REEDIT | 2 | The reedit operation is identical to the TXOP\_CREATE operation except that it operates on an existing control and its existing contents. If you have more than one active text edit control defined, then the [TXC.CTLNO](txtctl2.md#txc.ctlno) field of the _txtctl_ parameter must indicate which one to reedit. The [src](srcxtext.md)_ _parameter is ignored. |
| TXOP\_DELETE | 3 | The operation deletes the control, and is only necessary when the control was created with the [TXF\_MODELESS](xtext-flags.md#txf_modeless) flag (otherwise it would have been deleted automatically). Note that you can also delete the XTEXT control (like any other control) by clearing the screen with Tab(-1,0); |
| TXOP\_DISPLAY | 4 | The display operation creates the control, displays it, and leaves it on the screen (regardless of whether [TXF\_MODELESS](xtext-flags.md#txf_modeless) set. |
| TXOP\_SAVE | 5 | The save operation retrieves the current contents of the specified text control and either returns it to the application or writes it to a text file, depending on the [TXC.DOCFMT'DST](txc_docfmt-dst.md) flags. This is useful in conjunction with previous TXOP\_CREATE operations using TXF\_DEFERSAVE and TXF\_MODELESS _flags._ (TXOP\_SAVE overrides the TXF\_DEFERSAVE flag.) |
| TXOPF\_PRINT | \&h010 | May be added to TXOP\_CREATE or TXOP\_REEDIT to print an XTEXT document independently of anything else and outside of the normal A-Shell printing subsystem.<br>The combination TXOP\_CREATE + TXOPF\_PRINT can be used to print an XTEXT document from the source (file or buffer), while TXOP\_REEDIT + TXOPF\_PRINT can be used to print an XTEXT document that is currently open and displayed.<br>You may also request to have XTEXT display a standard printer select dialog by setting the flag TXF8\_SEL\_PTR\_DLG (\&h10000000) to the [TXC.FLAGS8](txc_flags8.md) field in the _txtctl_ parameter.<br>If the printer dialog option is not selected, then printing via TXOP\_CREATE + TXOPF\_PRINT will not display the XTEXT. |
| TXOPF\_PREVIEW | \&h020 | May be added to TXOP\_CREATE, TXOP\_REEDIT, or TXOP\_DISPLAY to cause XTEXT to display the print preview window. In the case of TXOP\_CREATE or TXOP\_REEDIT, the user will be left to manipulate the preview, which also means that he/she will be able to print and/or return to edit mode. |
|  |  | **Definition file: **[ashinc:xtext.def](https://bitbucket.org/microsabio/soslib/src/master/907016/xtext.def) |




