In addition to the A-BASIC and A-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 A-BASIC 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
However, in order to make this workable, you'll need to modify the ASHINC:XCALL.BSI file to merely set a flag indicating if it is running in SBX mode or not, instead of aborting with an error message if run directly using RUN MYPROG. You would then test that flag to decide whether to pick up and return parameters.
The /RC (Run Compatible) 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. NOTE: THIS PARAGRAPH is repeated in Plus Extensions. If you change it here, re-copy/paste there.
Extension |
/RC? |
Meaning |
3D Print Tab |
Note 1 |
Tab(x,y,z). See Three-D Print Tab. |
|
| |
Comment |
Yes |
Comment may follow an & on a continuation line |
|
| |
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 |
|
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). |
|
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. |
Dynamic variables |
|
|
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 <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 comma separated values | |
|
When the fourth parameter (flags) is specified (even if 0), the pattern is treated as a regular expression. | |
|
| |
Line length |
Yes |
Maximum source line length of 3070 instead of 512. |
|
PRIVATE and PUBLIC keywords for fine tuning scope of variables (MAP or DIMX). | |
|
Equivalent to ++ERROR <message> except that no error is generated. | |
Yes |
Nesting to 13 levels deep | |
|
Pad a string with spaces | |
Yes |
||
|
| |
|
Re-dimensions an array originally created with Dynamic Arrays (DIMX). | |
Return <expression> |
|
Return value from XFUNC |
Yes |
| |
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. |
Note 3 |
These statements open, print to, and close the debug message 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. |
|
| |
|
Output comma delimited values | |
WRITETD |
|
Deprecated; see WRITECD 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. |
|
Call an external (SBX) function | |
XGETARG |
|
Retrieve subroutine parameters. See X-ARGs. |
XGETARGS |
|
Retrieve subroutine parameters. See X-ARGs. |
XPUTARG |
|
Return subroutine parameters. See X-ARGs. |
XREAD |
|
Allow record access via explicit record numbers. See XREAD, XWRITE, XUNLOKR. |
XWRITE |
|
Allow record access via explicit record numbers. See XREAD, XWRITE, XUNLOKR. |
Notes
1: Compiler ignores "z" value.
2: DPRINT / EPRINT / TPRINT are compiled as if PRINT. DO NOT CHANGE THESE NOTE NUMBERS; THEY'RE REFERENCED ABOVE.
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.