# A-Shell Extensions

> [HTML Version](a-shellextensions.htm)

In addition to the AlphaBASIC and BASIC_plus_ statements, A-Shell also supports a set of statements which are only available under A-Shell—i.e., are not part of the AlphaBASIC environment. These statements are listed in the table below, and are referred to as the A-Shell Extensions. To invoke these extensions, use: 

•	/X:2 to create a standard .RUN file

•	/X:3 to create an .SBX file

Note that /X:3 does not disturb an existing .RUN, so it is possible to compile the same source into both a .RUN and a .SBX, as follows:

.COMPIL MYPROG/X:2    ; create MYPROG.RUN

.COMPIL MYPROG/X:3    ; create MYPROG.SBX



The /RC ([Run Compatible](runtimecompatible.md)) on COMPIL, when used in place of the /X:1 or /X:2 switch, allows many of these extensions to be compiled into a RUN format that remains compatible with AMOS. In the following table, the "/RC?" column says whether, when compiling with the RC switch, use of this statement or feature will produce a run file that is run compatible ("RC") with AMOS.  

| **Extension** | **/RC?** | **Meaning** |
|------|------|------|
| 3D Print Tab | Note 1 | Tab(x,y,z). See [Three-D Print Tab](three-dprinttab_ref.md). |
| [Call Stack Tracing](call_stack_tracing.md) |  |  |
| Comment | Yes | Comment may follow an \& on a continuation line |
| [COMPILER\_VERSION Macro](compiler_version_macro.md) |  |  |
| [Conditional Compilation](conditionalcompilation.md) | Yes |  |
| DEBUG |  | Control variable. If /DEBUG compile switch specified, acts as if it equals 1, otherwise 0. If /DEBUG switch is not specified, then it may still be activated at runtime by using SET DEBUG, or MX\_DEBUG. Note that for backwards compatibility, mapping DEBUG explicitly as an ordinary variable will disable the control variable DEBUG. See Note 3 below. |
| DEBUG statements | Yes | See [DEBUG Statements](debug-statements.md). |
| [DEFSTRUCT](defstruct.md) | Yes | Allows you to assign a type name to a set of MAP statements and then use that as if it was a data type. |
| DIMX  | Note 4 | Enhanced dynamic array allocation. See [Dynamic Arrays (DIMX)](dynamic_arrays_(dimx).md). |
| [Dot Variables](dotvariables.md) |  | Read-only system variables. |
| DPRINT | Note 2 | Creates a static text control using the current default GUI (proportional) font and with the sunken attribute. Note that if the /X:2 switch not specified, TPRINT is compiled as PRINT. Intended for displaying data fields. See [PRINT Statement](printstatement.md).  |
| Dynamic variables |  | [Dynamically Sized Variables](dynamically-sized_variables.md). |
| [ELSEIF Clauses](elseifclauses.md) | Yes | One or more ELSEIF clauses may be inserted into an extended IF/ELSEIF/ELSE/ENDIF statement. |
| EPRINT |  | Embeds the output fields in edit boxes; is typically used for displaying editable data fields. See PRINT.  |
| [++ERROR](error_compiler.md) <message> | Yes | Causes the message to be displayed and is treated as a compiler error. This is particularly useful in conjunction with conditional compilation, as shown in the preceding example. |
| [INPUT CSV](inputcsv.md) |  | Input comma separated values |
| [INSTR()](instr().md) |  | When the fourth parameter (flags) is specified (even if 0), the pattern is treated as a regular expression. |
| [ISAM File Statements](isamstatements.md) |  |  |
| Line length | Yes | Maximum source line length of 3070 instead of 512. |
| [MAP Statement](variablescope.md) |  | PRIVATE and PUBLIC keywords for fine tuning scope of variables (MAP or DIMX). |
| [++MESSAGE](message_compiler.md) |  | Equivalent to [++ERROR](error_compiler.md) <message> except that no error is generated.  |
| [Nested ++INCLUDEs](nestedincludes.md) | Yes | Nesting to 13 levels deep |
| [PAD()](pad().md) |  | Pad a string with spaces |
| [++PRAGMAs](pragmas.md) | Yes | [Compiler Directives](readforisam-a.md). |
| [Procedures](procedures.md) |  |  |
| [REDIMX](redimx.md) |  | Re-dimensions an array originally created with [Dynamic Arrays (DIMX)](dynamic_arrays_(dimx).md). |
| Return <expression> |  | Return value from [XFUNC()](xfunc().md). |
| [Shortcut Operators](shortcutoperators.md) | Yes |  |
| [Three-D Print Tab](three-dprinttab_ref.md) | Note 1 | Tab(x,y,z). |
| TPRINT | Note 2 | Same as DPRINT but without the sunken effect. Also note that SET AUTOTPRINT causes all PRINT statements to behave at runtime as if they were compiled as TPRINT. See [PRINT Statement](printstatement.md). |
| [TRACE Statements](trace_statements.md) | Note 3  | These statements open, print to, and close the System Messages window.  |
| Underlines in variable names | Yes | Variable names (and constants) may contain underlines. Although this has no special meaning, by convention it is used primarily with constants. |
| [Dynamic Structure Functions](dynamicstructurefunctions.md) |  |  |
| [WRITECD](writecd.md) |  | Output comma delimited values |
| WRITETD |  | **Deprecated**; see [WRITECD](writecd.md) for important note. Old documentation: same as WRITECD, except that it outputs Tab delimiters instead of comma delimiters.  |
| UNDEF <symbol> | Yes | Causes the specified symbol to be undefined, allowing it to be redefined or to fail a ++IFDEF symbol test. |
| [XFUNC()](xfunc().md) |  | Call an external (SBX) function |
| XGETARG |  | Retrieve subroutine parameters. See [X-ARGs](xgetarg_xgetargs.md). |
| XGETARGS |  | Retrieve subroutine parameters. See [X-ARGs](xgetarg_xgetargs.md). |
| XPUTARG |  | Return subroutine parameters. See [X-ARGs](xgetarg_xgetargs.md). |
| XREAD |  | Allow record access via explicit record numbers. See [XREAD, XWRITE, XUNLOKR](xreadxwritexunlokr.md). |
| XWRITE |  | Allow record access via explicit record numbers. See [XREAD, XWRITE, XUNLOKR](xreadxwritexunlokr.md). |




**Notes**

1:	Compiler ignores "z" value.

2:	DPRINT / EPRINT / TPRINT are compiled as if PRINT.

3:	TRACE.xxxx / DEBUG.xxxx are compiled as XCALL EVTWIN; need to supply AMOS implementation. 

4:	Statement will be compiled if OPTIONS=RC\_DIMX in miame.ini; however, the runtime token is not AMOS-compatible, so you must have other runtime logic to detect AMOS and avoid the statement. 