home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / Programme_zum_Heft / Programmieren / Kurztests / ACE / archive / ACE23.LHA / DOCS.lha / ref.doc < prev    next >
Text File  |  1994-10-22  |  107KB  |  2,661 lines

  1.                   +----------+
  2.                    | ACE v2.3 |
  3.                  +----------+
  4.  
  5.                +--------------------------------+
  6.                | Command and Function Reference | 
  7.                +--------------------------------+
  8.  
  9.                  ------------
  10.                  Introduction
  11.                  ------------
  12.  
  13. This document consists of a description of currently implemented commands 
  14. and functions.
  15.  
  16. As with AmigaBASIC, the case of commands and functions is of no consequence.
  17.  
  18. NOTES:     - [] means that a parameter or command component is optional.    
  19.           - <> surround literals, names and expressions.
  20.           - .. implies that statements are expected to follow.
  21.  
  22.     - Commands and functions marked with an asterix are found only in ACE, 
  23.       not AmigaBASIC.
  24.  
  25.     - Standard trigonometric functions take their arguments in radians.
  26.  
  27.     - EOS = end-of-string character (ASCII 0).
  28.     - MAXSTRINGLEN currently equals 1024. The last character in a string 
  29.       is EOS, so if you want a string which holds 1024 characters, you 
  30.       need a 1025 byte string (see STRING command).
  31.  
  32.     - For boolean operators such as AND,OR,IMP etc the values T and F
  33.       (TRUE and FALSE) refer to -1 and 0 respectively.
  34.  
  35. --------------------------------------------------------------------------------
  36. ABS        - syntax: ABS(n)
  37.         - Returns the absolute value of n. 
  38.  
  39. --------------------------------------------------------------------------------
  40. ADDRESS    *    - syntax: ADDRESS <identifier>[,..]
  41.         - Declares and initialises one or more variables of type
  42.           address. In fact, this data type is synonymous with the 
  43.           long integer (see LONGINT) data type. Its main purpose 
  44.           is to make clear just what sort of data is going to be
  45.           used. This is especially useful when passing addresses 
  46.           as parameters to subprograms.
  47.         - See also SUB, STRUCT.
  48.   
  49. --------------------------------------------------------------------------------
  50. ALLOC *        - syntax: ALLOC(<bytes>[,<memory-type>])
  51.         - This is ACE's hassle-free memory allocator.
  52.         - You can call this function to get the start address of a 
  53.           newly allocated block of memory at least <bytes> bytes in 
  54.           size.
  55.         - The <memory-type> argument can be one of the following:
  56.           
  57.             0 = CHIP memory
  58.             1 = FAST memory
  59.             2 = PUBLIC memory
  60.  
  61.             3 = CLEARED CHIP memory
  62.             4 = CLEARED FAST memory
  63.             5 = CLEARED PUBLIC memory
  64.  
  65.             6 = ANY suitable memory (MEMF_ANY)
  66.             7 = ANY suitable cleared memory
  67.  
  68.         - If a value outside this range is specified or this 
  69.           parameter is omitted, the result is identical to having
  70.           specified a <memory-type> of 7. Note that in ACE v2.0 the 
  71.           default was CLEARED PUBLIC memory. 
  72.         - Specifying ANY (6,7) allows the operating system to select
  73.           the best available memory, so specify a <memory-type> of 6 
  74.           or 7 for general use and CHIP memory for sound samples or 
  75.           any other data which must be accessible by the co-processors.
  76.         - If the requested block of memory can't be allocated
  77.           for whatever reason (eg. memory is too fragmented),
  78.           ALLOC returns zero.
  79.         - CLEARED memory is filled with zeros.
  80.         - The main benefit of ALLOC is that it keeps a record of
  81.           memory allocations, freeing all memory allocated via it 
  82.           at the end of a program run.
  83.         - ALLOC will free allocated memory even if a program aborts 
  84.           due to a ctrl-c break or an error (except where a GURU 
  85.           results).
  86.         - Use of ALLOC assumes that you know what you're doing with
  87.           memory and why you want a chunk of it.
  88.         - For more information about memory allocation on the Amiga,
  89.           see the Exec/Intuition autodocs re: AllocMem()/FreeMem()
  90.           and AllocRemember()/FreeRemember(). See also the manual
  91.           "RKM: Libraries". 
  92.         - See also CLEAR ALLOC.
  93.  
  94. --------------------------------------------------------------------------------
  95. AND        - Boolean operator: X AND Y.
  96.  
  97.             X Y    Out
  98.             -----------
  99.             T T    T
  100.             T F     F
  101.             F T      F
  102.             F F    F        
  103.         
  104. --------------------------------------------------------------------------------
  105. ARG$ *        - syntax: ARG$(n) where n=0..ARGCOUNT.
  106.         - Returns the nth command line argument as a string. 
  107.         - If n=0 the name of the command is returned.
  108.         - Note that ARG$ only works for CLI/Shell launched 
  109.           programs. See ace.doc for details about how to access
  110.           Workbench arguments.
  111.         - See also ARGCOUNT.
  112.  
  113. --------------------------------------------------------------------------------
  114. ARGCOUNT *    - Returns the number of command line arguments.
  115.         - See also ace.doc re: Workbench arguments.
  116.  
  117. --------------------------------------------------------------------------------
  118. AREA        - syntax: AREA [STEP](x,y)
  119.         - Functions indentically to AmigaBASIC's AREA command.
  120.         - Defines a set of up to 20 points to be joined
  121.           into a polygon and filled by AREAFILL.
  122.  
  123. --------------------------------------------------------------------------------
  124. AREAFILL    - syntax: AREAFILL [mode]
  125.         - Same as AmigaBASIC's AREAFILL command.
  126.         - The optional mode can be 0 or 1:
  127.             
  128.             0 = fill polygon with current pattern and 
  129.                 foreground color.
  130.  
  131.             1 = fill polygon with current pattern 
  132.                 but inverse of foreground color 
  133.                 (max-color-id - fdgnd-color-id).
  134.         
  135.         - See also PATTERN command.
  136.  
  137. --------------------------------------------------------------------------------
  138. ASC        - syntax: ASC(X$)
  139.         - Returns the ASCII code of the first character in X$.
  140.  
  141. --------------------------------------------------------------------------------
  142. ASSEM *        - syntax: ASSEM
  143.                 <line of assembly code>
  144.                 <line of assembly code>
  145.                 .
  146.                 .
  147.               END ASSEM
  148.         - This allows for the inline inclusion of assembly source
  149.           code into the A68K file generated by ACE.
  150.         - ACE does not attempt to check the correctness of the
  151.           inline code, leaving the task of assembly up to A68K.
  152.         - If you use this facility, it is assumed that you know
  153.           what you are doing.        
  154.         - For correct handling of the assembly source lines,
  155.           do not place ASSEM or END ASSEM on the same line as
  156.           any of the code you wish to include.
  157.         
  158. --------------------------------------------------------------------------------
  159. ATN        - syntax: ATN(n)
  160.         - Returns the arctangent of n.
  161.  
  162. --------------------------------------------------------------------------------
  163. BACK *        - syntax: BACK n        
  164.         - Moves the turtle back n steps.
  165.  
  166. --------------------------------------------------------------------------------
  167. BEEP        - Issues a brief pulse from the speaker.
  168.          - BEEP doesn't flash the screen as it does in AmigaBASIC.
  169.         - This command is useful for alerting the user to an error
  170.           or other important event.
  171.  
  172. --------------------------------------------------------------------------------
  173. BEVELBOX *    - syntax: BEVELBOX (x1,y1)-(x2,y2),style
  174.         - This command renders a Wb 2.x/3.0 style 3D bevel-box
  175.           according to the specified rectangle and style.
  176.         - The style parameter can take on the following values:
  177.  
  178.           Style        Bevel-Box
  179.           -----        ---------
  180.           1        RAISED
  181.           2        RECESSED
  182.           3        STRING-GADGET STYLE
  183.  
  184.         - The style parameter will have different results 
  185.           depending upon the combination of foreground and 
  186.           background colours. The above styles hold true for 
  187.           the standard Workbench 2.x colours.
  188.  
  189. --------------------------------------------------------------------------------
  190. BIN$ *        - syntax: BIN$(n)
  191.         - Returns a string containing the binary equivalent of n.
  192.         - If n is a single-precision value, ACE coerces it to integer.
  193.  
  194. --------------------------------------------------------------------------------
  195. BREAK        - syntax: BREAK ON|OFF|STOP 
  196.         - These commands are used for enabling, disabling and 
  197.           suspending ON BREAK event trapping.
  198.         - See the Event Trapping section in ace.doc.
  199.         
  200. --------------------------------------------------------------------------------
  201. CALL        - Passes control to a user-defined subprogram, 
  202.           shared library function, external function, 
  203.           or user-defined machine code routine.
  204.         - Subprogram CALLs can be recursive in ACE. 
  205.         - See also sections on subprograms, shared library access,
  206.           external functions and machine code calls in ace.doc.
  207.  
  208. --------------------------------------------------------------------------------
  209. CASE *        - This is ACE's version of the CASE statement and is different 
  210.           from the Pascal CASE and C switch statements.
  211.         - The syntax is:
  212.             
  213.             CASE
  214.               <expression> : <statement>
  215.               .
  216.               .
  217.              [<expression> : <statement>]
  218.             END CASE
  219.  
  220.            where <expression> can be any legal expression ranging
  221.            from a constant to a relational or mathematical expression.
  222.  
  223.         - The expression is used as a boolean such that 0 is false
  224.           and any non-zero value is true. 
  225.         - Each expression is evaluated until one is found to be
  226.           true. The corresponding statement is then executed.
  227.         - The statement can consist of a single legal ACE statement
  228.           (including block IF and loops) or a multi-statement.
  229.  
  230. --------------------------------------------------------------------------------
  231. CHDIR        - syntax: CHDIR <dirname>
  232.  
  233.           where <dirname> is a string corresponding to the name of
  234.           a directory.
  235.  
  236.         - If <dirname> is a legitimate directory and is accessible
  237.            from the current directory, it will become the new current
  238.           directory. 
  239.         - In short, this is ACE's equivalent of the AmigaDOS "cd"
  240.           command, the only difference being that the path change
  241.           is not reflected in the shell prompt (if the program is
  242.           run from the shell).
  243.  
  244. --------------------------------------------------------------------------------
  245. CHR$        - syntax: CHR$(n)
  246.         - Returns a string consisting of a single character with the
  247.           ASCII value n.
  248.   
  249. --------------------------------------------------------------------------------
  250. CINT        - syntax: CINT(n)
  251.         - Converts n to a signed short integer by rounding the 
  252.           fractional portion.
  253.         - When the fractional portion is exactly .5, CINT *always*
  254.           rounds up in ACE, whereas in AmigaBASIC if the integer
  255.           portion is even, CINT rounds down, and up if the integer
  256.           portion is odd.
  257.  
  258. --------------------------------------------------------------------------------
  259. CIRCLE        - syntax: CIRCLE (x,y),radius[,color-id,start,end,aspect]
  260.         - Start and end angles are specified in DEGREES *not* radians
  261.           because this is probably more useful when thinking about 
  262.           circles. (Note: this may be changed to radians in future).
  263.         - If a whole ellipse is to be drawn, the graphics library
  264.           DrawEllipse() function is used. However, if the start
  265.           angle is not 0 or the end angle is not 359 (these are
  266.           the defaults when not specified), a different routine 
  267.           is used. The latter is quite slow and may well be changed
  268.           in a future release of ACE.
  269.         - The default ASPECT is .44 as in AmigaBASIC.
  270.  
  271. --------------------------------------------------------------------------------
  272. CLEAR ALLOC *    - syntax: CLEAR ALLOC
  273.         - Frees all memory allocated by calls to ALLOC.
  274.         - Subsequent use of ALLOC is permitted.
  275.         - This allows for a more intelligent use of memory
  276.           allocation, especially when memory is tight.
  277.  
  278. --------------------------------------------------------------------------------
  279. CLNG        - syntax: CLNG(n)
  280.         - Converts n to a signed long integer by rounding the 
  281.           fractional portion.
  282.         - When the fractional portion is exactly .5, CLNG *always*
  283.           rounds up in ACE, whereas in AmigaBASIC if the integer
  284.           portion is even, CLNG rounds down, and up if the integer
  285.           portion is odd.
  286.  
  287. --------------------------------------------------------------------------------
  288. CLOSE        - syntax: CLOSE [#]filenumber[,[#]filenumber..] 
  289.           where filenumber represents an open file.
  290.         - This command closes at least one open file. 
  291.         - Note that in ACE, CLOSE must be followed by at least one 
  292.           filenumber, unlike AmigaBASIC.
  293.         - See section on files in ace.doc.
  294.          - See also ERR.
  295.  
  296. --------------------------------------------------------------------------------
  297. CLS        - Clears the current output window or screen and sets the
  298.           pen position to the upper left corner.
  299.         - CLS does not affect any other screens or windows except 
  300.           the one which is currently active.
  301.  
  302. --------------------------------------------------------------------------------
  303. COLOR        - syntax: color fgnd-id[,bgnd-id]
  304.         - Changes the foreground and/or background color to
  305.           fgnd-id and bgnd-id respectively.
  306.         - Note that in ACE, you can change just the foreground
  307.           color, both the foreground and background colors,
  308.           but not the background color alone. This may be changed 
  309.           in a future revision.
  310.         - The PALETTE command is used to change the colors 
  311.           corresponding to given color-ids.
  312.  
  313. --------------------------------------------------------------------------------
  314. CONST *        - syntax: CONST <ident> = [+|-]<constant>[,..]
  315.           where <constant> is a signed numeric constant.
  316.         - Defines a named numeric constant or constants, the type
  317.           being *unaffected* by the the DEFxxx directives or type 
  318.           (%&!#$) suffixes. All constant definitions are GLOBAL.
  319.         - A number of definitions can be separated by commas.
  320.  
  321. --------------------------------------------------------------------------------
  322. COS        - syntax: COS(n)
  323.         - Returns the cosine of n.    
  324.  
  325. --------------------------------------------------------------------------------
  326. CSNG        - syntax: CSNG(n)
  327.         - Converts n to a single-precision value.
  328.  
  329. --------------------------------------------------------------------------------
  330. CSRLIN        - Returns the print line in the current user-defined screen
  331.           or window.
  332.         - CSRLIN and POS have no meaning in a CLI/shell and will
  333.           return 0 if used when a CLI/shell is the current output
  334.           window. 
  335.  
  336. --------------------------------------------------------------------------------
  337. CSTR *        - syntax: CSTR(<address>) 
  338.         - Coerces a long integer address into a string. 
  339.         - This is intended for taking an allocated area of memory
  340.           and using it as a string of characters. Be aware that this
  341.           memory block must be NULL terminated.
  342.         - A typical use for CSTR is something like this:
  343.         
  344.             x$=CSTR(addr&)
  345.  
  346.         - The maximum string length of MAXSTRINGLEN bytes in some 
  347.           functions still applies.
  348.  
  349. --------------------------------------------------------------------------------
  350. DATA        - syntax: DATA [numeric-constant | string-constant][,..]
  351.         - Stores numeric and/or string constants into a global
  352.           data list to be accessed by the READ statement.
  353.         - DATA statements may be located anywhere in a program and
  354.           are non-executable.
  355.         - Strings need only be enclosed in quotes if they contain 
  356.           commas, spaces or colons or other non-identifier characters.
  357.         - In ACE, all numbers from DATA statements are currently stored 
  358.           as single-precision values with a possible loss of accuracy 
  359.           if LARGE long integers are originally specified. This may
  360.           be rectified in a future revision. Thus far however, I have 
  361.           not had problems because of it. In order to overcome this,
  362.           do the following:
  363.  
  364.             READ X$
  365.             X&=LONGINT(X$)        
  366.             DATA "123456789"
  367.  
  368.         - In the above example, the BASIC function VAL is substituted 
  369.           with LONGINT because the former always returns a single
  370.           precision value which is what we are trying to avoid, while
  371.           the latter extracts a long integer from a string.
  372.  
  373. --------------------------------------------------------------------------------
  374. DATE$        - Returns the current system date as a ten-character string
  375.           of the format: mm-dd-yyyy.
  376.  
  377. --------------------------------------------------------------------------------
  378. DAY *        - Returns the day of the week as an integer from 0..6,
  379.           where 0=Sunday and 6=Saturday.
  380.         - The value returned by DAY reflects the last call to DATE$
  381.           and is otherwise undefined.
  382.  
  383. --------------------------------------------------------------------------------
  384. DECLARE        - This has four uses in ACE: 
  385.  
  386.           1. DECLARE FUNCTION [<type>] <func-name>[%&!#$][(param-list)] 
  387.                               LIBRARY [<lib-name>]
  388.  
  389.              (see section on shared library functions in ace.doc)
  390.  
  391.           2. DECLARE FUNCTION [<type>] <func-name>[%&!#$][(param-list)] 
  392.                                      EXTERNAL
  393.  
  394.              which declares an external function. See also 
  395.              EXTERNAL command.
  396.  
  397.              (see section on External References in ace.doc)
  398.  
  399.           3. DECLARE SUB [<type>] subprogram-name[(param-list)] 
  400.                              [EXTERNAL]
  401.  
  402.              which is used for forward SUB declarations. If
  403.              the EXTERNAL keyword is used the subprogram is
  404.                expected to be defined in another ACE module.
  405.              The reference will be resolved at link time.
  406.  
  407.              (see "Creating & using ACE subprogram modules" 
  408.               in ace.doc)
  409.  
  410.           In 1,2 and 3 above, <type> may be one of the following:
  411.         
  412.             ADDRESS,LONGINT,SHORTINT,SINGLE,STRING
  413.  
  414.           while param-list consists of comma-separated identifiers
  415.           each optionally preceded by one of the above type 
  416.           specifiers.
  417.  
  418.           4. DECLARE STRUCT <type> [*] <ident1> [,[*] <identN>..]
  419.              
  420.              where a structure variable of type <struct-type> is
  421.              created. If "*" precedes the variable identifier,
  422.              a pointer to the structure is created, otherwise
  423.              a BSS object is allocated. In both cases, "identN"
  424.              holds the start address of the structure. In the
  425.              latter case, the address is resolved at load time
  426.              while in the former, the address is allocated at
  427.              run time (eg: with ALLOC).
  428.  
  429.         - Only the first usage is supported by AmigaBASIC (but 
  430.           without type specifier keywords).
  431.  
  432. --------------------------------------------------------------------------------
  433. DEF FN        - syntax: 
  434.           DEF [FN]funcname[!#%&$] [(param-list)] [EXTERNAL] = <expr>
  435.  
  436.         - As an extension to this syntax, in ACE it is also possible
  437.           to follow the DEF keyword with one of the following:
  438.     
  439.             ADDRESS,LONGINT,SHORTINT,SINGLE,STRING
  440.  
  441.         - These keywords may also precede each item in the
  442.           parameter list.
  443.         - This command provides the simple defined function
  444.           capability found in many BASICs.
  445.         - The parameters are passed by value and are combined
  446.           in the expression on the right hand side of the "=" to
  447.           yield a function return value.
  448.         - Like a subprogram, a defined function in ACE doesn't have
  449.           access to global variables. Unlike the former, DEF FNs
  450.           cannot use SHARED to get around this. In other words, if
  451.           the function needs to use a particular value, you must
  452.           pass it to the function via the parameter list. If a 
  453.           variable is defined in the expression (just by being used)
  454.           its value will be local to the function (and unknown).
  455.         - The function may only be invoked as part of an expression,
  456.           eg: 
  457.  
  458.             DEF SEC(x)=1/COS(x)
  459.             PRINT SEC(12)
  460.  
  461.           defines and invokes the secant function which can then be
  462.           used in the same way as other built-in functions (eg: COS).
  463.         
  464.         - Note from the above that the "FN" prefix is optional
  465.           in ACE. If used, there must be no spaces between "FN"
  466.           and the function name.  
  467.         - The fact that subprograms (SUBs) in ACE have return
  468.           values and so can be treated as functions obviates the
  469.           need for DEF FN to some extent, but the shorter definition
  470.           may be considered better in some cases. Contrast the
  471.           above definition with the following:
  472.  
  473.             SUB SEC(x)
  474.               SEC=1/COS(x)
  475.             END SUB 
  476.  
  477.         - A slightly different example is:
  478.  
  479.             DEF ADDRESS chipmem(bytes&) = ALLOC(bytes&,0)
  480.  
  481.           which when invoked would return the start address of 
  482.           a block of CHIP memory.
  483.         - Once a function has been defined, you cannot redefine
  484.           it (AmigaBASIC allows this) in the same program.
  485.         - If the optional EXTERNAL keyword is used, the function
  486.            will be externally visible to other modules. See ace.doc
  487.           section "Creating & using ACE subprogram modules".
  488.         - See the file ACEinclude:MathFunc.h for examples of
  489.           defined functions (taken from Appendix E of the
  490.           AmigaBASIC Manual). 
  491.  
  492. --------------------------------------------------------------------------------
  493. DEFxxx        - syntax: DEFxxx <letter> | _ [-<letter> | _] [, ..]
  494.  
  495.         - The DEFxxx commands (DEFINT,DEFLNG,DEFSNG,DEFDBL,DEFSTR) 
  496.           are global data type directives which affect data objects 
  497.           in both the main program and subprograms.
  498.         - For example:
  499.  
  500.             DEFLNG    a-z,_
  501.   
  502.           declares all data objects to be of type LONGINT unless 
  503.           overridden by another DEFxxx directive, variable declaration 
  504.           or trailing character (%&!#$).
  505.          - DEFDBL currently defaults to single-precision since 
  506.           double-precision floating-point is not yet supported by ACE.
  507.   
  508. --------------------------------------------------------------------------------
  509. DIM        - syntax: 
  510.           DIM [<type>]<name>(<i>[,..]) [SIZE <n>] [ADDRESS <addr>][,..]
  511.  
  512.           where <type> may be one of the following:
  513.  
  514.             ADDRESS,LONGINT,SHORTINT,SINGLE,STRING 
  515.  
  516.         - ACE requires that _all_ arrays be dimensioned before use.
  517.         - For a subscript range of 0..n, you must DIMension
  518.           an array with an index of n.
  519.         - Up to 255 dimensions can be specified with up to
  520.           32767 elements per dimension. On a 3 Mb machine, around
  521.           11 dimensions is the practical limit.
  522.         - Each dimension must be specified as a short integer constant 
  523.           (literal or defined). 
  524.         - The SIZE option is for the specification of string element
  525.           length other than the default MAXSTRINGLEN value.
  526.         - The ADDRESS option allows you to specify some arbitrarily 
  527.           allocated area of memory for the array space.
  528.         - Both options (SIZE and ADDRESS) may be used together in
  529.           DIM. This is not so for simple (string) variables where
  530.           only one or the other may be used (see STRING command).
  531.           When used in DIM, the SIZE option specifies how big each
  532.           string element is to be.
  533.         - SHARED is not an option and ACE arrays are shared in the
  534.           same way as variables. See "Subprograms" in ace.doc.
  535.         - Arrays may be dynamically allocated in ACE, eg:
  536.  
  537.             CONST STRSIZE=80 
  538.             myStrArrayAddr& = ALLOC(numlines*STRSIZE) 
  539.             IF myStrArrayAddr& = 0& THEN STOP 
  540.             DIM wds$(1) SIZE STRSIZE ADDRESS myStrArrayAddr& 
  541.  
  542.           This will allocate space for an array of numlines strings, 
  543.           each 80 bytes in length. A single array element is 
  544.           specified just to keep ACE happy, but since there is no
  545.           array range checking, and the ADDRESS option has been
  546.           used, the number of elements in the array is in reality
  547.           numlines (a variable containing say, the number of lines
  548.           in a file). 
  549.  
  550.           Note that this means that you will be able to access
  551.           elements from 0..numlines-1. If you want 0..numlines
  552.           - or even 1..numlines - then the ALLOC line must read:
  553.  
  554.             myStrArrayAddr& = ALLOC((numlines+1)*STRSIZE) 
  555.     
  556.           Here's a more complex example, showing how to
  557.           dynamically allocate space for a 2D array:
  558.  
  559.             rangeArray& = ALLOC((N+1) * (SIZEOF(SHORTINT)*(3+1)))
  560.             IF rangeArray& = 0 THEN STOP
  561.             DIM range%(1,3) ADDRESS rangeArray&
  562.  
  563.           The first index is just to keep ACE happy. Space is 
  564.           allocated via ALLOC and the really critical thing here 
  565.           is the "3" indicating how many columns in the table (as 
  566.           it were)  - 0 to 3 - to ensure correct array element 
  567.           calculations. 
  568.  
  569.           Since ACE does no run-time array bounds checking, you can 
  570.           specify range%(N,M) where N>=0 and M>=0 and M<=3. The zeroth
  571.           index is the reason why we need the +1 in two places in the 
  572.           above ALLOC call.
  573.  
  574.           See also ACEinclude:array_size.h for a subprogram which
  575.           returns the correct size to be passed to ALLOC for 2D and 3D
  576.           arrays, thus making such calculations unnecessary.
  577.  
  578. --------------------------------------------------------------------------------
  579. EOF        - syntax: EOF(n)
  580.           where n is the filenumber of an open file.
  581.         - EOF is a function which returns either -1 or 0 depending
  582.           upon whether the file pointer has reached the end-of-file
  583.           or not. 
  584.         - If the file doesn't exist or hasn't been opened, EOF 
  585.           returns -1. 
  586.          - See also ERR.
  587.  
  588. --------------------------------------------------------------------------------
  589. END        - Closes standard libraries, performs other cleanup operations
  590.           and passes control back to parent process (CLI/Shell or Wb).
  591.         - Don't use END within an IF..THEN..END IF block. Use STOP
  592.           instead which is functionally equivalent in ACE.
  593.  
  594. --------------------------------------------------------------------------------
  595. ERR        - syntax: ERR
  596.         - This parameterless function returns the error code 
  597.           corresponding to a failed operation (or zero if no
  598.           error has occurred) and then *immediately* clears the 
  599.           error code (sets it to zero).
  600.         - It is important to realise that the error code is
  601.           cleared before the function returns its value, since 
  602.           unless this value is stored, it will be lost.
  603.         - The most typical usage is as part of a conditional test, 
  604.           eg: IF ERR<>0 THEN PRINT "Error!":STOP
  605.         - ERR may also be called after an error has been trapped
  606.           by the ON ERROR event trapping mechanism. See ace.doc
  607.           for more details about event trapping in ACE. 
  608.         - Here are the current codes:
  609.  
  610.              -- AmigaBASIC codes --
  611.             52  - Bad File Number
  612.             54  - Bad File Mode
  613.  
  614.             -- AmigaDOS codes --
  615.             103 
  616.             to
  617.             233 - See The AmigaDOS Manual (Bantam), 
  618.                   Error Codes and Messages.
  619.  
  620.             -- ACE codes --
  621.             300 - Error opening serial port
  622.             301 - Error closing serial port
  623.             302 - Error reading from/querying serial port
  624.             303 - Error writing to serial port
  625.             304 - Bad channel number/serial port not open
  626.  
  627.             400 - Error opening message channel
  628.             401 - Error closing message channel
  629.             402 - Error reading message channel
  630.             403 - Error writing to message channel
  631.             404 - Error waiting on message channel
  632.             405 - Bad message channel
  633.  
  634.             500 - Error opening IFF file
  635.             501 - Error closing IFF file
  636.             502 - Error reading IFF file
  637.             503 - Bad IFF channel     
  638.        
  639.             600 - Error opening screen
  640.     
  641.             700 - Error opening window
  642.  
  643. --------------------------------------------------------------------------------
  644. ERROR        - syntax: ERROR ON|OFF|STOP 
  645.         - These commands are used for enabling, disabling and 
  646.           suspending ON ERROR event trapping.
  647.         - See the Event Trapping section in ace.doc.
  648.         
  649. --------------------------------------------------------------------------------
  650. EQV        - Boolean operator: X EQV Y.
  651.  
  652.             X Y    Out
  653.             -----------
  654.             T T    T
  655.             T F    F
  656.             F T    F
  657.             F F    T            
  658.                         
  659. --------------------------------------------------------------------------------
  660. EXIT FOR *    - This command allows for the premature, conditional
  661.           termination of a FOR..NEXT loop.
  662.         - Since ACE uses the stack for FOR..NEXT loop counter & step
  663.           values, issuing a RETURN inside a FOR loop is dangerous
  664.           because the top item on the stack is something other
  665.           than the expected return address.
  666.         - In short, leaving a FOR loop before it has finished and 
  667.           never returning (CALL and GOSUB are okay since they will
  668.           return to the loop) is unsafe in ACE, which is why EXIT
  669.           FOR has been provided because it properly cleans up the 
  670.           stack before prematurely exiting the loop.
  671.         - When nesting one FOR loop inside another, be aware that
  672.           the inner FOR loop's EXIT FOR will override any previous 
  673.           EXIT FOR directives in the enclosing outer FOR loop.
  674.           As a consequence of this:
  675.  
  676.             FOR I=1 TO 10
  677.                 PRINT I
  678.               FOR J=1 TO 5
  679.                 PRINT J
  680.                 IF MOUSE(0) THEN EXIT FOR
  681.               NEXT
  682.               IF MOUSE(0) THEN EXIT FOR
  683.             NEXT
  684.  
  685.           will have the desired effect, whereas:
  686.  
  687.             FOR I=1 TO 10
  688.                 PRINT I
  689.               IF MOUSE(0) THEN EXIT FOR  '..overridden below!
  690.               FOR J=1 TO 5
  691.                 PRINT J
  692.                 IF MOUSE(0) THEN EXIT FOR
  693.               NEXT
  694.             NEXT
  695.  
  696.           will not. Observe the effect of running these two
  697.           code fragments in order to see what's going on here.
  698.  
  699. --------------------------------------------------------------------------------
  700. EXIT SUB    - This command can only be used inside a subprogram and
  701.           when encountered, has the effect of passing control back
  702.           to the caller of the subprogram in which it appears.
  703.         - If the current instantiation of the subprogram is the
  704.           result of a recursive call, control will be returned
  705.           to the previous instantiation of the same subprogram.
  706.  
  707. --------------------------------------------------------------------------------
  708. EXP        - syntax: EXP(n)
  709.         - Returns e to the power n, where e is the base of
  710.           natural logarithms or 2.7182818284590.
  711.  
  712. --------------------------------------------------------------------------------
  713. EXTERNAL *    - syntax: EXTERNAL [FUNCTION] [<type>] <identifier>[%&!$]
  714.         - Used to declare an external function or variable.
  715.         - To declare the data type of an external object, either
  716.           qualifier characters or one of the following type keywords
  717.           may be used:
  718.  
  719.             ADDRESS,LONGINT,SHORTINT,SINGLE,STRING
  720.  
  721.         - See the section on External References in ace.doc.
  722.         - See also the DECLARE command for an alternative
  723.           (and better) external function declaration syntax.
  724.  
  725. --------------------------------------------------------------------------------
  726. FILEBOX$ *    - syntax: FILEBOX$(title-string[,default-directory])
  727.         - This function invokes a file requester and returns
  728.           the user's selection as a fully qualified path.
  729.         - The title-string is displayed in the title bar of
  730.           the file requester (eg: "Open", "Select a file").
  731.         - If the (optional) default-directory is specified,
  732.           the file requester's initial "view" will be in that 
  733.           directory.
  734.         - If the program is running under Wb 2.04 or higher,
  735.           an ASL file requester appears. If not, an Arp 
  736.           requester is invoked which means that if you are
  737.           running Wb 1.3 or lower, you'll need arp.library
  738.           in your LIBS: directory.
  739.         - If you are using FileBox$ under Wb 1.3 make sure
  740.           you have a stack (in the shell/CLI or Tool) which
  741.           is at least 5000 bytes in size.
  742.           
  743. --------------------------------------------------------------------------------
  744. FILES        - syntax: FILES [TO <storefile>] [,<target>]
  745.         - Gives an unsorted directory listing ala AmigaBASIC
  746.           except that ACE's version takes two optional arguments
  747.           while AmigaBASIC's takes one (<target>).
  748.         - If <storefile> is specified, the listing will be
  749.              captured by that file.
  750.            - If <storefile> is omitted, it is assumed that the
  751.           program containing the FILES command was invoked 
  752.           from a shell or CLI (since the listing will be 
  753.           displayed). 
  754.            - The <target> argument can be a file, directory or
  755.              AmigaDOS device name which is to be the subject
  756.           of the directory listing.
  757.  
  758. --------------------------------------------------------------------------------
  759. FIX        - syntax: FIX(n)
  760.         - The function returns the truncated integer portion of n.
  761.         - FIX(n) is equivalent to SGN(n)*INT(ABS(n)).
  762.         - Whereas INT(n) rounds off a negative number
  763.           to the next lowest whole number, FIX does not.
  764.  
  765.         or
  766.  
  767.         - syntax: FIX n
  768.         - The command which is found only in ACE is intended to have
  769.           a similar effect to the FIX button found on some calculators
  770.           that is, to change the number of decimal places ACE rounds a
  771.           single-precision number to.
  772.         - FIX utilises the ami.lib function arnd(). When the value of
  773.           n is anything other than 8, arnd() is invoked. This affects
  774.           the commands: PRINT, PRINTS, WRITE#, PRINT# and STR$. 
  775.         - FIX should be considered experimental since I have not 
  776.           completely figured out what all the values of n (as used 
  777.           directly by arnd()) do yet.
  778.         - In a future release, a given value for n may have different 
  779.           results than it does now. Currently, n may be positive or 
  780.           negative.
  781.         
  782.             Examples
  783.             --------
  784.  
  785.             FIX -3
  786.             PRINT 12.3456
  787.  
  788.             would display: 12.35
  789.  
  790.         - PRINT USING will obviate the need for this command in
  791.           a future release in any case.
  792.  
  793. --------------------------------------------------------------------------------
  794. FONT *        - syntax: FONT <name>,<size>
  795.         - Changes the font for the current output window. 
  796.         - <font> is a string such as "opal" or "opal.font"
  797.           and <size> is an integer point size.
  798.         - Currently only works for windows created with the
  799.           WINDOW command, not for shells.
  800.         - It is best to follow a FONT statement with a LOCATE command
  801.           to "notify" the window of the font change (eg. LOCATE 1,1).
  802.           This ensures correct line-feed height for future PRINT statements.
  803.         - See also the STYLE command (which works in ALL windows).
  804.  
  805. --------------------------------------------------------------------------------
  806. FOR..NEXT    - syntax: FOR <variable>=x TO y [STEP z]
  807.         - The statements between FOR and NEXT are iterated
  808.           the number of times it takes for <variable> to become
  809.           equal to or greater than y (or less than y if z is negative)
  810.           starting from x. The loop index <variable> is incremented 
  811.           by z, or 1 if STEP is not specified. 
  812.            - NEXT can only be followed by a variable, colon or
  813.           comment and must appear on a separate line or in a 
  814.           multi-statement (not after THEN for example). 
  815.         - Any attempt to use a shared variable as a FOR loop index
  816.           will result in an (intentional) compilation error.
  817.          - If you want to branch out of a FOR loop never to return,
  818.           use EXIT FOR. See also the further discussion of this
  819.           issue (including RETURNing from within a FOR loop) in the
  820.           "Limitations" section of ace.doc.
  821.         
  822. --------------------------------------------------------------------------------
  823. FORWARD *    - syntax: FORWARD n
  824.         - Move the turtle forward n steps.
  825.  
  826. --------------------------------------------------------------------------------
  827. FRE        - syntax: FRE(n)
  828.           where n is -1,0,1,2 or 3.
  829.         - Since ACE's run-time environment is different to
  830.           AmigaBASIC's, FRE returns different values and 
  831.           takes different arguments than in AmigaBASIC.
  832.         - FRE returns the amount of free system memory according 
  833.           to n:
  834.  
  835.             n = -1    ->  total CHIP + FAST memory free.
  836.             n =  0  ->  total CHIP memory free.
  837.             n =  1  ->  total FAST memory free.
  838.             n =  2  ->  largest contiguous CHIP memory available.
  839.             n =  3  ->  largest contiguous FAST memory available.
  840.  
  841. --------------------------------------------------------------------------------
  842. GADGET *    - syntax: GADGET id,status[,gadval,rectangle,type[,style]]
  843.  
  844.           where id is a unique gadget ID from 1 to 255 and status
  845.           is 1 or 0 to enable or disable the gadget, respectively.
  846.            The keywords ON and OFF can be used instead of 1 and 0.
  847.  
  848.         - The remainder of the parameters are optional, but all
  849.           except style must be specified when creating a new 
  850.           gadget. If a string or longint gadget has no style
  851.           specification, the default is left-justification of text.
  852.  
  853.         - The first of these, gadval, is either a string or long
  854.           integer (see below); rectangle defines the border of
  855.           the gadget as (x1,y1)-(x2,y2).
  856.  
  857.         - The GADGET command creates a new gadget or alters the
  858.           status of an existing gadget according to the above
  859.           and in accordance with the final two parameters: type 
  860.           and style, as follows (gadval meaning is also shown):
  861.  
  862.         - Type may either be a numeric value from 1 to 5 or one
  863.           of the following keywords: BUTTON, STRING, LONGINT,
  864.           POTX or POTY, correspondingly.
  865.  
  866.           Type    Gadget       Style    Effect             GadVal
  867.           ----    ------      -----    ------             ------
  868.           1    Boolean   1    All points inside the     Gadget text
  869.                       gadget are complemented
  870.                     when it is clicked (this
  871.                     is the default).        
  872.                  
  873.                   2     A box is drawn around     Gadget text
  874.                     the gadget when clicked.
  875.  
  876.                   3    Borderless.         Gadget text
  877.  
  878.  
  879.           2    String      1    Center justifies text.     Default text
  880.                 
  881.                   2    Right justifies text.
  882.                 
  883.                   (The default is left justification).
  884.  
  885.  
  886.           3    LongInt      1    Center justifies number. Default number
  887.                                  (as string)
  888.                   2    Right justifies number.
  889.  
  890.                   (The default is left justification).
  891.  
  892.  
  893.           4    Horiz.
  894.             Slider      1    Borderless.         Maximum
  895.                                  slider value
  896.                                   (0..gadval)
  897.  
  898.           5    Vertical
  899.             Slider      1    Borderless.         Maximum
  900.                                   slider value
  901.                                  (0..gadval) 
  902.  
  903.     OR
  904.  
  905.         - syntax: GADGET(n)
  906.  
  907.           where n is a number from 0 to 3.
  908.  
  909.         - The GADGET function returns information about the
  910.           last gadget event according to the following:
  911.  
  912.           N    Returns
  913.           -    -------
  914.           0    -1 if a gadget event has occurred since the last
  915.             call to GADGET(0), 0 otherwise.
  916.         
  917.           1    The number of the last gadget selected. If the
  918.             window's close gadget was clicked after doing a
  919.             GADGET WAIT 0, 256 will be returned. This is not 
  920.             the case for event trapping of gadgets, where
  921.             ON WINDOW should be used instead.
  922.  
  923.           2    Returns the address of the string from the most 
  924.             recently selected string gadget or the long integer
  925.             value from the most recently selected LongInt gadget.
  926.             In the former case, use ACE's CSTR function to convert
  927.             the address into an ACE string.
  928.  
  929.           3    Returns the slider position of the most recently
  930.             selected (horizontal or vertical) proportional gadget.
  931.         
  932. --------------------------------------------------------------------------------
  933. GADGET CLOSE *    - syntax: GADGET CLOSE id
  934.         - This command removes the specified gadget from the
  935.           current output window and should always be called
  936.           when you are finished with a gadget.
  937.         - Make sure that the window belonging to the gadget you 
  938.           wish to close is the current output window (see WINDOW
  939.           OUTPUT command below).
  940.  
  941. --------------------------------------------------------------------------------
  942. GADGET MOD *    - syntax: GADGET MOD id,knob-position[,max-positions]
  943.         - This command modifies the specified proportional
  944.           gadget.
  945.         - The new knob position (within the gadget's body) must 
  946.           be specified.
  947.         - The optional max-positions parameter if specified changes
  948.           the number of discrete positions in which the knob may be
  949.           found. A significant change from the previous value given
  950.           (eg. see the gadval parameter in the GADGET command) may
  951.           result in a change to the knob size.
  952.         
  953. --------------------------------------------------------------------------------
  954. GADGET ON .. *    - syntax: GADGET ON|OFF|STOP 
  955.         - These commands are used for enabling, disabling and 
  956.           suspending ON GADGET event trapping.
  957.         - See the Event Trapping section in ace.doc.
  958.         
  959. --------------------------------------------------------------------------------
  960. GADGET WAIT *    - syntax: GADGET WAIT id
  961.         - This command puts the program to sleep until it receives
  962.           a message that the specified gadget has been selected.
  963.         - If id=0 the program will wake up when ANY gadget is 
  964.           selected. A call to GADGET(1) can then be used to 
  965.           determine the number of the gadget.
  966.  
  967. --------------------------------------------------------------------------------
  968. GOSUB..RETURN    - syntax: GOSUB <label> | <line>
  969.         - GOSUB transfers control to the specified label or line.
  970.         - RETURN passes control back to the statement following the
  971.           most recent GOSUB command.
  972.         - Issuing a RETURN without a matching GOSUB will generally
  973.           invoke the GURU.
  974.  
  975. --------------------------------------------------------------------------------
  976. GOTO        - syntax: GOTO <label> | <line>
  977.         - Transfers control to the specified label or line.
  978.  
  979. --------------------------------------------------------------------------------
  980. HANDLE *    - syntax: HANDLE(n)
  981.           where n is the file number of an OPENed file (1..255).
  982.         - This function returns a long integer which is a pointer to
  983.           a dos file handle suitable for use with dos.library functions
  984.           such as Read (xRead when declared in ACE/AmigaBASIC). 
  985.         - If HANDLE returns 0 the file does not exist or can't be
  986.           opened as requested.
  987.  
  988. --------------------------------------------------------------------------------
  989. HEADING *    - Returns the turtle's current heading in degrees (0..359).
  990.  
  991. --------------------------------------------------------------------------------
  992. HEX$        - syntax: HEX$(n)
  993.         - Returns a string which represents the hexadecimal value
  994.           of the decimal argument n.
  995.  
  996. --------------------------------------------------------------------------------
  997. HOME *        - Move the turtle to its home position.
  998.  
  999. --------------------------------------------------------------------------------
  1000. IF        - syntax: IF..THEN..[ELSE..]
  1001.               IF..GOTO..[ELSE..]
  1002.               IF..THEN
  1003.               .
  1004.               [ELSE]
  1005.               .
  1006.               END IF         
  1007.         - ELSEIF is not yet implemented.
  1008.         - IF..[ELSE]..END IF blocks can be nested.
  1009.         - Use STOP rather than END before an END IF
  1010.           otherwise the compiler will become confused.
  1011.         - There must be _something_ between IF..THEN
  1012.           and END IF, even if only a blank line or comment,
  1013.           eg.
  1014.                 IF x=2 THEN
  1015.                   '..do something or maybe nothing
  1016.                 END IF        
  1017.  
  1018. --------------------------------------------------------------------------------
  1019. IFF *        - syntax: IFF(channel,n)
  1020.         - This function returns information about the IFF graphics
  1021.           file associated with the specified channel.
  1022.         - The channel parameter must be in the range 1..255.
  1023.         - The values returned are dictated by N thus:
  1024.  
  1025.           N    Return value
  1026.           -     ------------
  1027.           0    Address of name of IFF picture form (eg: ILBM). 
  1028.             Use ACE's CSTR function to retrieve the string.        
  1029.           1    Width of picture.
  1030.           2    Height of picture.
  1031.           3    Depth of picture.
  1032.           4    Screen Mode to use in SCREEN command. Note: if
  1033.             IFF(channel,3) returns a depth of 6, HAM mode
  1034.             is currently assumed even though it might be
  1035.             extra-halfbrite. If the picture doesn't render
  1036.             correctly, use screen-mode 6 rather than 5 (see
  1037.             SCREEN command). Alternatively, don't specify 
  1038.             the screen-id when using the IFF READ command.
  1039.             This issue may be resolved in a future revision.
  1040.  
  1041.         - Information returned by values to this function when
  1042.           N is in the range 1..4 can be used directly in a SCREEN
  1043.           command.
  1044.         - See also IFF OPEN, IFF READ and ERR.
  1045.         
  1046. --------------------------------------------------------------------------------
  1047. IFF CLOSE *    - syntax: IFF CLOSE [#]channel
  1048.         - Closes the specified IFF channel.
  1049.         - If a screen was opened by IFF READ, IFF CLOSE will
  1050.           close this.    
  1051.         - See also ERR.
  1052.  
  1053. --------------------------------------------------------------------------------
  1054. IFF OPEN *    - syntax: IFF OPEN [#]channel,file-name
  1055.         - This command associates an IFF picture file with the
  1056.           specified channel.
  1057.         - All subsequent IFF command/function calls use this
  1058.           channel number.
  1059.         - The IFF OPEN command also stores important information
  1060.           about the picture file for IFF READ and IFF(channel,n).
  1061.         - See also ERR.
  1062.  
  1063. --------------------------------------------------------------------------------
  1064. IFF READ *    - syntax: IFF READ [#]channel[,screen-id]
  1065.         - This command loads the IFF picture from the file 
  1066.           associated with the specified channel.
  1067.         - The screen-id is optional. If not supplied, a non-ACE
  1068.           screen and window will be used to display the picture,
  1069.           which is closed later by a call to IFF CLOSE.
  1070.         - Otherwise, the screen should be opened in accordance with 
  1071.           the information returned via the IFF function (see above).
  1072.         - See also ERR and ace.doc.
  1073.         
  1074. --------------------------------------------------------------------------------
  1075. IMP        - Boolean operator: X IMP Y.
  1076.  
  1077.             X Y    Out
  1078.             -----------
  1079.             T T    T
  1080.             T F     F
  1081.             F T    T
  1082.             F F    T        
  1083.  
  1084. --------------------------------------------------------------------------------
  1085. INKEY$        - syntax: INKEY$
  1086.         - Returns a single character string when a keystroke 
  1087.           is pending, otherwise the NULL string is returned.
  1088.         - INKEY$ works fine in user-defined windows, but since
  1089.           a normal CON: window intercepts all keystrokes, INKEY$
  1090.           is not very useful in a shell/CLI.
  1091.  
  1092. --------------------------------------------------------------------------------
  1093. INPUTBOX *    - syntax: INPUTBOX(prompt[,title][,default][,xpos][,ypos])
  1094.         - This function returns a long integer value after invoking
  1095.           a requester which prompts the user to enter a value. If
  1096.           you need to get a single-precision value, apply VAL to
  1097.           the result of the INPUTBOX$ function (see next entry).
  1098.         - An OK and Cancel gadget allow the user to accept or reject
  1099.           the entered value. Zero is returned if the Cancel gadget
  1100.           is selected.
  1101.         - The prompt string must be specified but all other
  1102.           parameters are optional: title goes into the requester's
  1103.           title bar; default is a string containing a default
  1104.           integer value which becomes the return value if nothing
  1105.           is entered; xpos and ypos specify where to place the
  1106.           requester on the screen.
  1107.         - Example: num& = INPUTBOX("Enter a number:",,"12345")
  1108.  
  1109. --------------------------------------------------------------------------------
  1110. INPUTBOX$ *    - syntax: INPUTBOX$(prompt[,title][,default][,xpos][,ypos])
  1111.         - This function returns a string value after invoking
  1112.           a requester which prompts the user to enter a value.
  1113.         - An OK and Cancel gadget allow the user to accept or reject
  1114.           the entered string. If Cancel is selected the NULL string
  1115.           is returned. 
  1116.         - The prompt string must be specified but all other
  1117.           parameters are optional: title goes into the requester's
  1118.           title bar; default is a string return value to be used if
  1119.           no new value is entered; xpos and ypos specify where to 
  1120.           place the requester on the screen.
  1121.         - Example: command$ = INPUTBOX$("Enter a command:")
  1122.  
  1123. --------------------------------------------------------------------------------
  1124. INPUT        - syntax: INPUT [<prompt-string>] [;|,] var1 [[;|,] varN..]
  1125.         - Strings, integers and fixed-point or exponential format 
  1126.           single-precision values can be input from the keyboard.
  1127.         - Each value must appear on a separate line even when
  1128.           a single INPUT statement contains multiple variables.  
  1129.         - If a semicolon precedes a variable "? " will appear, while 
  1130.           if a comma is used no "? " will appear.
  1131.         - As of ACE v2.0 INPUT works with any screen or window mode.
  1132.  
  1133. --------------------------------------------------------------------------------
  1134. INPUT #        - syntax: INPUT #filenumber,<variable-list>
  1135.         - Reads data items from a sequential file.
  1136.         - The variables in <variable-list> must each match the type
  1137.           of item being read.
  1138.         - If unambiguous data format is required, it is best to
  1139.           use WRITE# to store the values that INPUT# will read
  1140.           since WRITE# separates each item with commas and delimits
  1141.           strings with double quotes allowing for spaces. WRITE# will
  1142.           also result in more efficient use of disk space and faster
  1143.           reading by INPUT#.
  1144.         - ACE accepts white space (line feeds, spaces, tabs), commas
  1145.           and quotes as delimiters for each field in a sequential file.
  1146.         - AmigaBASIC and ACE sequential file formats are virtually
  1147.           identical.
  1148.         - See also "Files" section in ace.doc.
  1149.          - See also ERR.
  1150.  
  1151. --------------------------------------------------------------------------------
  1152. INPUT$        - syntax: INPUT$(X,[#]filenumber)
  1153.         - Returns a string of X characters from the filenumber'th file.
  1154.         - There is a 32K upper limit for X in ACE, but if you
  1155.           want to read a whole file for example, and the file length
  1156.           (determined by the LOF function) is greater than MAXSTRINGLEN
  1157.           you should do the following:
  1158.  
  1159.             STRING myString SIZE N
  1160.             OPEN "I",#1,filename$
  1161.              myString = INPUT$(LOF(1),#1)
  1162.             CLOSE #1
  1163.  
  1164.           or if you want to allocate space at run-time according to the
  1165.           exact file size:
  1166.  
  1167.             bytes& = LOF(1) + 1    '..need "+1" for EOS marker
  1168.             addr& = ALLOC(bytes&)
  1169.             STRING myString ADDRESS addr&
  1170.             OPEN "I",#1,filename$
  1171.              myString = INPUT$(bytes&,#1)
  1172.             CLOSE #1
  1173.         
  1174.         - This method should only be used for small text files as it
  1175.           is slow, and text is really the only useful thing to put in 
  1176.           a string if you wish to manipulate it. Some string functions
  1177.           will react unexpectedly to non-text characters in strings.
  1178.         - If you wish to read a large file rapidly, it's best to use 
  1179.           the dos.library function Read (declared as xRead in BASIC).
  1180.           The sound player play.b gives an example of this.
  1181.         - In general INPUT$ is most useful for reading a few characters
  1182.           at a time from a file. If you wish to read a line at a time,
  1183.           use LINE INPUT#. Use INPUT# if you want to read numbers or
  1184.           delimited strings. 
  1185.         - INPUT$ in ACE is only used for sequential file input, so
  1186.           the filenumber is not optional. In AmigaBASIC, if the latter
  1187.           is omitted, input is taken from the keyboard. Not so in ACE.
  1188.         - See also section on files in ace.doc.
  1189.  
  1190. --------------------------------------------------------------------------------
  1191. INSTR        - syntax: INSTR([I,]X$,Y$)
  1192.         - INSTR searches for the first occurrence of Y$ in X$ and
  1193.           returns the character position from 1..N in X$.
  1194.         - If the optional offset I is specified, the search starts
  1195.           from that position, otherwise the search starts from the
  1196.           first character in X$.
  1197.         - If I is greater than len(X$) or X$="" or Y$ is not found
  1198.           in X$ or len(Y$) > len(X$), INSTR returns 0.
  1199.         - If Y$="", INSTR returns I or 1.
  1200.         - X$ and Y$ can be string expressions, variables or literals
  1201.           or any combination thereof.
  1202.  
  1203. --------------------------------------------------------------------------------
  1204. INT        - syntax: INT(n)
  1205.         - Returns the largest integer less than or equal to n.
  1206.  
  1207. --------------------------------------------------------------------------------
  1208. KILL        - syntax: KILL <filespec>
  1209.         - Deletes a file or directory.
  1210.  
  1211. --------------------------------------------------------------------------------
  1212. LEFT$        - syntax: LEFT$(X$,I)
  1213.         - Returns a string which contains the leftmost I characters
  1214.           of X$.
  1215.         - If I > len(X$), the whole string (X$) is returned.
  1216.         - If I = 0, the NULL string is returned.
  1217.  
  1218. --------------------------------------------------------------------------------
  1219. LEN        - syntax: LEN(X$)
  1220.         - Returns the number of characters in X$.
  1221.  
  1222. --------------------------------------------------------------------------------
  1223. LET        - syntax: [LET] <variable> = <expression>
  1224.         - LET assigns a value to a variable.
  1225.         - Its use is optional so that LET X=1 is equivalent
  1226.           to X=1.
  1227.  
  1228. --------------------------------------------------------------------------------
  1229. LIBRARY        - syntax: LIBRARY [CLOSE] [<libname>]
  1230.         - Opens or closes one or more Amiga shared libraries.
  1231.         - Note that <libname> may be with or without quotes
  1232.           and can either end in ".library", ".bmap" or have no
  1233.           file extension whatever in ACE.
  1234.         - For example, to open the graphics library, two legal 
  1235.           syntaxes are: 
  1236.  
  1237.             LIBRARY graphics 
  1238.           and
  1239.             LIBRARY "graphics.library"
  1240.  
  1241.         - LIBRARY CLOSE closes all open libraries or a single library
  1242.           can be specified instead.
  1243.         - See "Shared library function calls" section in ace.doc.
  1244.  
  1245. --------------------------------------------------------------------------------
  1246. LINE        - The syntax of this command - apart from the simple 
  1247.           case of LINE (x1,y1)-(x2,y2)[,color,b[f]] - is a little
  1248.           unclear from the AmigaBASIC manual.
  1249.  
  1250.         - The syntax of the LINE command in ACE is currently as 
  1251.           follows:
  1252.  
  1253.             LINE [STEP](x1,y1)[-(x2,y2)[,[color],[b[f]]]]
  1254.  
  1255.         - The second STEP directive has been omitted, but may be
  1256.           added in a future revision.
  1257.         - A statement such as LINE STEP (100,90) will cause a line
  1258.           to be drawn from the last referenced coordinate to 100,90.
  1259.           In addition, this use of LINE does *not* allow for colour
  1260.           setting as can be seen from the ACE syntax specification
  1261.           whereas LINE (100,90)-(200,150),color does. The same is
  1262.           true for the "b" and "bf" options. A future version may
  1263.           correct this problem.
  1264.         - Note: When using "b" or "bf", x2 must be >= x1 and y2 must 
  1265.           be >= y1 otherwise display weirdness will result!
  1266.  
  1267. --------------------------------------------------------------------------------
  1268. LINE INPUT    - syntax: LINE INPUT #filenumber,<string-variable>
  1269.         - Reads a line from the filenumber'th sequential file and
  1270.           stores it in <string-variable> (simple variable or array
  1271.           element).
  1272.         - If <string-variable> does not exist, ACE creates it.
  1273.         - Lines are delimited by a line-feed character (ASCII 10)
  1274.           and the string which is returned consists of the characters
  1275.           up to but not including the line-feed.
  1276.         - Note that the AmigaBASIC manual (8-72) shows a semicolon
  1277.           instead of a comma in the above syntax which is incorrect
  1278.           since AmigaBASIC itself accepts only a comma.
  1279.         - The alternative form of LINE INPUT for keyboard input is
  1280.           not currently implemented in ACE.
  1281.         - LINE INPUT will not read more than MAXSTRINGLEN characters.
  1282.         - See also INPUT$ (which will read up to 32K of characters),
  1283.           INPUT# and ace.doc's section on files.
  1284.         - See also ERR.
  1285.  
  1286. --------------------------------------------------------------------------------
  1287. LOCATE        - syntax: LOCATE line[,column].
  1288.         - LOCATE changes the printing position for the current
  1289.           screen or window.
  1290.         - Note that the use of LOCATE on a screen or user-defined 
  1291.           window currently also changes the next graphics drawing 
  1292.           coordinates. 
  1293.  
  1294. --------------------------------------------------------------------------------
  1295. LOF        - syntax: LOF(n) 
  1296.           where n is the file number of an open file. 
  1297.         - LOF returns the length of the file in bytes. 
  1298.         - If the file is not open or is non-existent, LOF returns 0.
  1299.         - See also ERR.
  1300.  
  1301. --------------------------------------------------------------------------------
  1302. LOG        - syntax: LOG(n)
  1303.         - Returns the natural logarithm of n (log base e of n).
  1304.         - The argument n should be greater than zero.
  1305.  
  1306. --------------------------------------------------------------------------------
  1307. LONGINT    *    - syntax: LONGINT <identifier>[,..]
  1308.         - Declares and initialises (to zero) one or more long integer 
  1309.           variables.
  1310.  
  1311.     OR
  1312.  
  1313.         - syntax: LONGINT(X$)
  1314.         - This function returns the numeric value of X$ as a long
  1315.           integer number.
  1316.         - The hexadecimal and octal directives (&H and &O) may prefix
  1317.           the string in order to allow the handling of these bases.
  1318.         - LONGINT strips off leading whitespace (eg: spaces, tabs).
  1319.          - The main use for this function is to overcome the loss of 
  1320.           accuracy which results when VAL is used to extract a _large_ 
  1321.           long integer value from a string.
  1322.          - See also VAL.
  1323.  
  1324. --------------------------------------------------------------------------------
  1325. MENU        - syntax: MENU menu-id,item-id,state[,title[,command-key]]
  1326.         - This command creates or modifies the state of a menu or 
  1327.           menu item as per AmigaBASIC.
  1328.         - The final optional parameter is peculiar to ACE and if
  1329.           used, specifies the Amiga-<key> sequence which if issued
  1330.           results in the selection of the corresponding menu option. 
  1331.           The command key option is displayed along with the menu
  1332.           item when the menu is rendered.
  1333.         - The state parameter can have the following values:
  1334.  
  1335.             State        Effect
  1336.             -----        ------
  1337.         
  1338.             0        Menu or item is disabled (shadowed).
  1339.     
  1340.             1        Menu or item is enabled.        
  1341.  
  1342.             2        Menu item is checkmarked.
  1343.                     There must be at least 2 spaces
  1344.                     preceding the item for the tick
  1345.                     to be rendered properly.
  1346.  
  1347.         - The most advisable method of creating menus is to start
  1348.           from the first menu and first item in each menu, and code 
  1349.           them in sequence thereafter.
  1350.  
  1351.     OR
  1352.  
  1353.         - syntax: MENU(n)
  1354.         - This function returns information about the most recently
  1355.           selected menu and item. If n=0 the number of the menu is
  1356.           returned. If n=1 the number of the menu item is returned.
  1357.         - MENU(0) returns 0 between menu events after being called
  1358.           once for a particular menu selection.
  1359.         - This function must be used in conjunction with MENU event
  1360.           trapping or WAITing.
  1361.  
  1362. --------------------------------------------------------------------------------
  1363. MENU CLEAR *    - syntax: MENU CLEAR
  1364.         - This command is the equivalent of MENU RESET in AmigaBASIC.
  1365.         - The result of calling this is to clear the menu strip for 
  1366.           the current output window. In AmigaBASIC the initial menu
  1367.           for the interpreter's window is restored if a new menu is
  1368.           set up in that window. This does not apply in ACE.
  1369.         - WINDOW CLOSE performs a menu clear in case you don't.
  1370.  
  1371. --------------------------------------------------------------------------------
  1372. MENU ON ..    - syntax: MENU ON|OFF|STOP 
  1373.         - These commands are used for enabling, disabling and 
  1374.           suspending ON MENU event trapping.
  1375.         - See the Event Trapping section in ace.doc.
  1376.         
  1377. --------------------------------------------------------------------------------
  1378. MENU WAIT *    - syntax: MENU WAIT
  1379.         - This command puts the program to sleep until menu activity
  1380.           is detected.
  1381.             
  1382. --------------------------------------------------------------------------------
  1383. MESSAGE CLEAR *    - syntax: MESSAGE CLEAR [#]channel
  1384.         - Clears the message port associated with the specified
  1385.           channel. 
  1386.         - See also ERR.
  1387.  
  1388. --------------------------------------------------------------------------------
  1389. MESSAGE CLOSE *    - syntax: MESSAGE CLOSE [#]channel
  1390.         - Closes the specified message channel.
  1391.         - See also ERR.
  1392.  
  1393. --------------------------------------------------------------------------------
  1394. MESSAGE OPEN *    - syntax: MESSAGE OPEN [#]channel,port-name,mode
  1395.         - Creates a message channel for reading (mode="R") 
  1396.           or writing (mode="W").
  1397.         - If the channel is for writing, the port-name is
  1398.           the name of a message port which is assumed to
  1399.           exist. If it does not exist an error will result 
  1400.           (see ERR).
  1401.           You can therefore poll a remote port to determine
  1402.           when it has been created.
  1403.         - See also ERR.
  1404.  
  1405. --------------------------------------------------------------------------------
  1406. MESSAGE READ *    - syntax: MESSAGE READ [#]channel,buffer
  1407.         - Reads a message into buffer from the specified message 
  1408.           channel.
  1409.         - See also ERR.
  1410.  
  1411. --------------------------------------------------------------------------------
  1412. MESSAGE WAIT *    - syntax: MESSAGE WAIT [#]channel
  1413.         - Waits for a message to appear on the specified channel.
  1414.         - Please note that if no message is forthcoming, this
  1415.           command will wait forever.
  1416.         - Waiting on a port opened for writing (mode = "W") has the 
  1417.           effect of waiting for the remote task to signal that it has 
  1418.           accepted a message written to its port. This allows for 
  1419.           synchronisation between processes, ie. A writes to B, B 
  1420.           accepts message from A, A continues processing.
  1421.         - See also ERR.
  1422.  
  1423. --------------------------------------------------------------------------------
  1424. MESSAGE WRITE *    - syntax: MESSAGE WRITE [#]channel,buffer
  1425.         - Writes a message to the specified message channel from
  1426.           the buffer.
  1427.         - See also ERR.
  1428.  
  1429. --------------------------------------------------------------------------------
  1430. MID$        - syntax: MID$(X$,I[,J])
  1431.         - Only the MID$ _function_ is currently implemented in ACE.
  1432.         - Returns a string containing J characters from X$ starting 
  1433.           from the Ith character.
  1434.         - If J is omitted or there are fewer than J characters 
  1435.           to the right of (and including) the Ith character, all 
  1436.           characters from the Ith position to the end of the string 
  1437.           are returned.
  1438.         - If I > len(X$), MID$ returns the NULL string.
  1439.   
  1440. --------------------------------------------------------------------------------
  1441. MOD        - Modulo arithmetic operator: X MOD Y.
  1442.  
  1443.             eg: 101 MOD 10 = 1
  1444.     
  1445. --------------------------------------------------------------------------------
  1446. MOUSE        - syntax: MOUSE(n)
  1447.         - Returns information about the current status of the mouse.
  1448.         - Values of n ranging from 0..2 are presently meaningful in ACE.
  1449.         - MOUSE(0) returns -1 or 0 to indicate whether the left 
  1450.           mouse button is currently being pressed or not.
  1451.         - MOUSE(1) returns the X location of the mouse pointer
  1452.           in the current output window or screen.
  1453.         - MOUSE(2) returns the Y location of the mouse pointer
  1454.           in the current output window or screen.
  1455.         - Future revisions of ACE will add more functionality to
  1456.           MOUSE(n).
  1457.  
  1458. --------------------------------------------------------------------------------
  1459. MOUSE ON ..    - syntax: MOUSE ON|OFF|STOP 
  1460.         - These commands are used for enabling, disabling and 
  1461.           suspending ON MOUSE event trapping.
  1462.         - See the Event Trapping section in ace.doc.
  1463.         
  1464. --------------------------------------------------------------------------------
  1465. MSGBOX *    - syntax: MSGBOX(message,button-text1[,button-text2])
  1466.         - This function invokes a system requester having one or
  1467.           two buttons (boolean gadgets) with the specified text
  1468.           in each, plus a message in the requester's main body
  1469.           as specified by the message parameter.
  1470.         - If only button-text1 is given, a single button is
  1471.           rendered, otherwise two buttons appear.
  1472.         - The function's return value is -1 or 0 depending
  1473.           upon whether the first or second button is selected by
  1474.           the user. With only one button present, the return
  1475.           value is always -1.
  1476.  
  1477.         - Example: result = MsgBox("Really Quit?","Yes","No")
  1478.     OR
  1479.         - syntax: MSGBOX message,button-text
  1480.         - This statement can be used to display a simple system
  1481.           requester. Since no value is returned via this statement,
  1482.           only a single button is permitted.
  1483.  
  1484.         - Example: MsgBox "File Deleted!","Continue"    
  1485.  
  1486.         - Note that the message may only consist of a single line
  1487.           but a future revision will allow for multiple lines.
  1488.          - Note also that under Wb 1.3 the "message" text is used
  1489.           to determine the width of the requester. Under Workbench 
  1490.           2.x/3.0, the operating system proportions the requester 
  1491.           appropriately.
  1492.  
  1493. --------------------------------------------------------------------------------
  1494. NAME        - syntax: NAME <filespec1> AS <filespec2>
  1495.         - Renames a file or directory.
  1496.     
  1497. --------------------------------------------------------------------------------
  1498. NOT        - Boolean operator: NOT X.
  1499.  
  1500.             X    Out
  1501.             -----------
  1502.             T    F
  1503.             F    T
  1504.  
  1505. --------------------------------------------------------------------------------
  1506. OCT$        - syntax: OCT$(n)
  1507.         - Returns the octal string representation of the long
  1508.           integer value n.
  1509.  
  1510. --------------------------------------------------------------------------------
  1511. ON..GOTO/GOSUB    - syntax 1: ON <integer-expr> GOTO | GOSUB <label> | <line>
  1512.  
  1513.           eg: ON n GOTO one,two,three,four,five
  1514.             
  1515.           such that if n=1 the program will branch to the label 
  1516.           "one" and if n=4 the branch will be to "four".
  1517.  
  1518.         - syntax 2: ON <event-spec> GOTO | GOSUB <label> | <line>
  1519.         - See "Event Trapping" section in ace.doc.
  1520.  
  1521. --------------------------------------------------------------------------------
  1522. OPEN        - syntax: OPEN mode,[#]filenumber,<filespec>
  1523.           which is the same as syntax 1 in AmigaBASIC
  1524.           except that no file-buffer size can be specified.
  1525.         - Mode is an upper or lower case character where:
  1526.  
  1527.             - "I" = open file for input
  1528.  
  1529.             - "O" = open file for output
  1530.  
  1531.             - "A" = open file for appending; 
  1532.                 creates new file if <filespec>
  1533.                 doesn't exist.
  1534.         
  1535.         - Filenumber is a value from 1..255 and <filespec> 
  1536.           is a string containing the file name (eg: "test.doc",
  1537.           "df1:letters/santa").
  1538.         - Multiple files can be open simultaneously.
  1539.         - See also ERR.
  1540.  
  1541. --------------------------------------------------------------------------------
  1542. OPTION *    - syntax: OPTION <switch>+|-[,<switch>+|-..]
  1543.         - Compiler directives (switches) can be issued via this
  1544.           command instead of from the command line. The latter
  1545.           only allows for compiler directives to be *activated*.
  1546.         - Each switch must be followed by a "+" or "-" with
  1547.           the former activating the directive and the latter
  1548.           neutralising it.
  1549.         - Switches currently implemented are: b,c,E,i,l,m,O,w
  1550.          - See ace.doc, "Compiler options" for details of each
  1551.           switch. Notice that for switches i and O, activation 
  1552.           or deactivation takes effect at the end of compilation.
  1553.  
  1554. --------------------------------------------------------------------------------
  1555. OR        - Boolean operator: X OR Y.
  1556.  
  1557.             X Y     Out
  1558.             -----------
  1559.             T T    T
  1560.             T F    T
  1561.             F T    T
  1562.             F F     F
  1563.  
  1564. --------------------------------------------------------------------------------
  1565. PAINT        - syntax: PAINT (x,y)[[,color-id][,border-id]]
  1566.         - PAINT flood-fills an enclosed region with the
  1567.           color specified by color-id and if the latter
  1568.           is omitted, the current foreground pen is used.
  1569.         - If border-id is not specified, color-id is used 
  1570.           to determine when to stop the filling process by 
  1571.           looking for a border of that color. The use of 
  1572.           border-id allows a region to be filled with one 
  1573.           color and be bordered by another.
  1574.         - x and y can be anywhere within the enclosed region.
  1575.         - Note that the ACE version of PAINT has no STEP 
  1576.           option so x and y constitute an absolute coordinate.
  1577.         - STEP may be added in a future revision.
  1578.  
  1579. --------------------------------------------------------------------------------
  1580. PALETTE        - syntax: PALETTE color-id,R,G,B
  1581.           where R,G,B are the red, green and blue color 
  1582.           components of color-id, each in the range 0..1.
  1583.         - Palette changes colors in the current screen 
  1584.           (including the Workbench!). 
  1585.  
  1586. --------------------------------------------------------------------------------
  1587. PATTERN        - syntax: PATTERN [line-pattern][,area-pattern] | RESTORE
  1588.         - Same as in AmigaBASIC with the addition of a RESTORE
  1589.           option. PATTERN RESTORE resets the line and area patterns
  1590.           to their default values.
  1591.         - The line-pattern is a short integer value.
  1592.         - The area-pattern is a DIM'd short integer array. 
  1593.         - The number of elements in area-pattern must be a power of 2.
  1594.  
  1595. --------------------------------------------------------------------------------
  1596. PEEKx        - syntax: PEEKx(<address>)
  1597.         - The functions PEEK,PEEKW and PEEKL return an 8-bit, 16-bit 
  1598.           and 32-bit value from memory, respectively.
  1599.  
  1600. --------------------------------------------------------------------------------
  1601. PENDOWN *    - Lowers the turtle's "pen". This enables drawing by the
  1602.           turtle graphics commands.
  1603.  
  1604. --------------------------------------------------------------------------------
  1605. PENUP *        - Raises the turtle's "pen". This disables drawing by the
  1606.           turtle graphics commands.
  1607.         
  1608. --------------------------------------------------------------------------------
  1609. POINT        - syntax: POINT(x,y)
  1610.         - Returns the color-id of a point in the current output
  1611.           window or screen.
  1612.  
  1613. --------------------------------------------------------------------------------
  1614. POKEx        - syntax: POKEx <address>,<numeric-value>
  1615.         - The commands POKE,POKEW and POKEL change the contents of 
  1616.           <address> to <numeric-value>.
  1617.         - The number of bits affected is 8, 16 and 32 respectively.
  1618.         - Unless you know what you are POKEing and why, don't (!!)
  1619.           or you can expect a visit from the Guru.
  1620.         
  1621. --------------------------------------------------------------------------------
  1622. POS        - Returns the print column in the current user-defined screen
  1623.           or window.
  1624.         - Note that the syntax is different from AmigaBASIC where a
  1625.           dummy argument of zero is used: POS(0).
  1626.         - POS and CSRLIN have no meaning in a CLI/shell and will
  1627.           return 0 if used when a CLI/shell is the current output
  1628.           window. 
  1629.  
  1630. --------------------------------------------------------------------------------
  1631. POTX *        - syntax: POTX(n)
  1632.           where n=0 or 1 (game port 1 or 2).
  1633.         - Returns a short integer value corresponding to the
  1634.           current potentiometer reading on pin 5 of the game port.
  1635.          - POTX(0) returns 0 currently.
  1636.  
  1637. --------------------------------------------------------------------------------
  1638. POTY *        - syntax: POTY(n)
  1639.           where n=0 or 1 (game port 1 or 2).
  1640.         - Returns a short integer value corresponding to the
  1641.           current potentiometer reading on pin 9 of the game port.
  1642.         - POTY(0) returns 0 currently. 
  1643.  
  1644. --------------------------------------------------------------------------------
  1645. PRINT        - syntax: PRINT [<expression>][,|;| ..]
  1646.           where <expression> is a string or numeric value to
  1647.           be printed at the current print location of the current
  1648.           (DOS or Intuition) output window. 
  1649.         - LOCATE can be used to set the location for the next PRINT 
  1650.           command. So can SETXY for printing in a non-shell window.
  1651.         - PRINT can be abbreviated to '?' as in AmigaBASIC.
  1652.         - If <expression> is followed by a semi-colon, a line-feed
  1653.           will not occur before the next PRINT.
  1654.         - If <expression> is followed by a comma, the effect is
  1655.           the same except that first, a horizontal tab (CHR$(9)) 
  1656.           is sent to the output window.
  1657.         - Note that ASCII 9 does not have exactly the same effect 
  1658.           as an AmigaBASIC tab, but the result is similar. 
  1659.           If spacing is critical, you should use TAB or SPC.
  1660.  
  1661. --------------------------------------------------------------------------------
  1662. PRINT #        - syntax: PRINT #filenumber,<expression>[,|;| ..]
  1663.           where <expression> is a string or numeric value to
  1664.           be printed at the current print location in the 
  1665.           filenumber'th file. 
  1666.         - PRINT can be abbreviated to '?' as in AmigaBASIC.
  1667.         - This version of PRINT # writes values to a file in the 
  1668.           same format as they would appear in a window.
  1669.         - One oddity is that since ACE strings are NULL-terminated,
  1670.           and this NULL (ASCII 0) is normally not displayed, any 
  1671.           attempt to send this character to a file, eg:
  1672.  
  1673.               PRINT #filenumber,CHR$(0) 
  1674.  
  1675.           should by all rights be ignored. However, since some
  1676.           programs write NULLs to files as delimiters, ACE does NOT
  1677.           ignore a lone CHR$(0). A consequence of this is that if
  1678.           you send an empty - LEN(<string>) = 0 - string to a file, 
  1679.           an ASCII 0 will be written. This also holds true for 
  1680.           WRITE #filenumber,<string>. Just check the length of a 
  1681.           string before sending it to a file if in doubt.
  1682.         - Given the above behaviour, use:
  1683.         
  1684.             PRINT #filenumber,CHR$(10)
  1685.           or
  1686.             PRINT #filenumber," "    '..at least 1 space
  1687.  
  1688.           to cause a line-feed to be sent to the file.
  1689.          - See also ERR.
  1690.  
  1691. --------------------------------------------------------------------------------
  1692. PRINTS *    - syntax: PRINTS [<expression>][,|;| ..]
  1693.           where <expression> is a string or numeric value to
  1694.           be printed at the current x,y location of an open
  1695.           screen or Intuition window. SETXY or LOCATE can be used 
  1696.           to set the X,Y coordinates for the next PRINTS command.
  1697.         - This command is now redundant since as of ACE v2.0 PRINT
  1698.           handles DOS and Intuition windows/screens transparently.
  1699.         - However since PRINTS doesn't have to make a decision
  1700.           about whether to print to a DOS or Intuition window, 
  1701.           it is faster than PRINT. It is not intended for use in 
  1702.           a CLI/shell however.
  1703.  
  1704. --------------------------------------------------------------------------------
  1705. PSET        - syntax: PSET [STEP] (x,y)[,color-id]
  1706.         - Plots a point in the current output window or 
  1707.           screen.
  1708.         - If color-id is not specified, the current
  1709.           foreground color is used.
  1710.         - If STEP is specified, the point is relative to
  1711.           the current x,y location as set by the last
  1712.           graphics command.
  1713.  
  1714. --------------------------------------------------------------------------------
  1715. PTAB        - syntax: PTAB(n)
  1716.           where n is in the range: 0..32767
  1717.         - This function is used in conjunction with PRINT to
  1718.           move the horizontal print position for the current 
  1719.            output window to the nth pixel.
  1720.         - Subsequent graphics commands are also affected by
  1721.           PTAB.
  1722.             
  1723. --------------------------------------------------------------------------------
  1724. RANDOMIZE    - syntax: RANDOMIZE <expression>
  1725.         - Seeds the random number generator.
  1726.         - In ACE, RANDOMIZE *requires* an argument. TIMER and 
  1727.           all other arguments will be coerced to long integers.
  1728.         - RANDOMIZE TIMER is the most commonly used syntax.
  1729.  
  1730. --------------------------------------------------------------------------------
  1731. READ        - syntax: READ <variable>[,<variableN>..]
  1732.         - Assigns <variable> the value of the next item in the 
  1733.           global data list as created by DATA statements in
  1734.           the current program.
  1735.         - The <variable> must be of the same type as the data 
  1736.           item to be read otherwise an unexpected value will be
  1737.           assigned to <variable>.  
  1738.         - See also DATA (especially re: READing long values).
  1739.     
  1740. --------------------------------------------------------------------------------
  1741. REM        - syntax: REM <comment>
  1742.         - A single-line comment.
  1743.         - All characters after REM until the end of line are 
  1744.           ignored.
  1745.         - REM can be substituted by an apostrophe as in AmigaBASIC.
  1746.         - While REM is treated as a true statement, and must
  1747.           either appear on a separate line or after a ":" in a 
  1748.           multi-statement, an apostrophe followed by a comment
  1749.           can appear anywhere in the text of a program. 
  1750.         - Note that ACE also supports block comments: {..}.
  1751.         - The ACE compiler can handle the three types of comments
  1752.           while the pre-processor APP can only handle the ' and 
  1753.           {..} forms. Some form of commenting is required by APP
  1754.           so that pre-processor commands can be commented out. 
  1755.  
  1756. --------------------------------------------------------------------------------
  1757. REPEAT..UNTIL *    - syntax: REPEAT
  1758.               .
  1759.               .
  1760.               UNTIL <condition>
  1761.  
  1762.           where <condition> is an expression which reduces
  1763.           to a boolean (true/false) value.
  1764.  
  1765.         - Statements between the REPEAT and UNTIL are executed
  1766.           until the <condition> is true (ie: non-zero).      
  1767.         - Styled after the Pascal REPEAT..UNTIL construct.
  1768.         - The loop is always executed at least once.
  1769.  
  1770. --------------------------------------------------------------------------------
  1771. RESTORE        - syntax: RESTORE
  1772.         - Resets the DATA pointer to the first DATA statement
  1773.           in the program.
  1774.         - Note that there is no optional label in the ACE version
  1775.           of RESTORE. This may be added in a future revision.
  1776.  
  1777. --------------------------------------------------------------------------------
  1778. RIGHT$        - syntax: RIGHT$(X$,I)
  1779.         - Returns a string which contains the rightmost I characters
  1780.           of X$.
  1781.         - If I > len(X$), the whole string (X$) is returned.
  1782.         - If I = 0, the NULL string is returned.
  1783.  
  1784. --------------------------------------------------------------------------------
  1785. RND        - syntax: RND[(X)]
  1786.         - The RND function takes an optional parameter and always 
  1787.           returns a single-precision pseudo-random value between 0 
  1788.           and 1.
  1789.         - At present if it is supplied, X is ignored in ACE.
  1790.  
  1791. --------------------------------------------------------------------------------
  1792. SADD        - syntax: SADD(<string-expression>)
  1793.         - Returns the address of <string-expression> which can be
  1794.           a string literal, variable or expression.
  1795.         - Unlike AmigaBASIC, string allocations after a call to
  1796.           SADD have no impact upon the address of <string-expression>.
  1797.         - VARPTR can also safely be used to find the address of
  1798.           a string variable.
  1799.                   
  1800. --------------------------------------------------------------------------------
  1801. SAY        - In ACE, there is a SAY command and a SAY function.
  1802.  
  1803.         SAY command 
  1804.         -----------
  1805.         - syntax: SAY <phoneme-string>[,mode-array]
  1806.         - Same as AmigaBASIC's SAY command: speak a phoneme string.
  1807.         - The <phoneme-string> can be a string literal, expression
  1808.           or variable, while the optional mode-array is a 9-element 
  1809.           (0..8) DIM'd short integer array.
  1810.         - The mode-array is allowed, and the following parameters
  1811.           are supported:
  1812.  
  1813.             Argument     Element    Values        Default    
  1814.             --------     -------    ------        -------
  1815.             pitch         0        65..320        110
  1816.             inflection   1        0 or 1        0    
  1817.             rate         2        40..400        150
  1818.             voice         3        0 or 1        0
  1819.             tuning         4        5000..28000    22200 (Hz)
  1820.             volume         5        0..64        64
  1821.             channel         6        0..11        10
  1822.             mode         7        0 or 1        0
  1823.             control         8              0,1 or 2    0
  1824.  
  1825.         - Inflection=0 allows inflections and emphasis of syllables 
  1826.           while inflection=1 gives a monotone voice.
  1827.         - The voice parameter specifies gender: 0=male; 1=female.
  1828.         - Audio channel values have the same meaning as in AmigaBASIC:
  1829.  
  1830.             Value    Channel(s)
  1831.             -----     ----------
  1832.             0    0
  1833.             1    1
  1834.             2    2
  1835.             3    3
  1836.             4    0 and 1
  1837.             5    0 and 2
  1838.             6    3 and 1
  1839.             7    3 and 2
  1840.             8    either available left channel
  1841.             9    either available right channel
  1842.             10    either available left/right pair of channels
  1843.             11    any available single channel        
  1844.  
  1845.         - Mode is used to specify synchronous or asynchronous speech
  1846.           (0 and 1 respectively).
  1847.         - Control is used when mode=1 to determine what action is
  1848.           to be taken when asynchronous speech is active. If control
  1849.           is set to 0, the current SAY command waits until the last
  1850.           SAY is finished before executing. When control=1 the last
  1851.           SAY statement is cancelled and speech processing stops
  1852.           until the next call to SAY. When control=2 ACE interrupts
  1853.           the last SAY command and initiates the current one.
  1854.         - The defaults are the same as in AmigaBASIC.
  1855.  
  1856.         SAY function    (only works properly under 2.04 or higher)
  1857.         ------------
  1858.         - syntax: SAY(n)
  1859.  
  1860.           where n equals 0, 1 or 2.
  1861.  
  1862.           SAY(0) - returns true or false (-1 or 0) to indicate
  1863.                whether there is currently active asynchronous
  1864.                speech.
  1865.  
  1866.           SAY(1) - returns the width of the "mouth" corresponding
  1867.                to the phoneme being spoken.
  1868.     
  1869.           SAY(2) - returns the height of the "mouth" corresponding
  1870.                to the phoneme being spoken.
  1871.     
  1872.         - SAY(0) allows for monitoring of the asynchronous 
  1873.           speech process (see details of mode-array above).
  1874.         - Use of SAY(1) and SAY(2) allows an animated mouth
  1875.           to be drawn.
  1876.         - SAY(1)'s and SAY(2)'s values reflect the last call
  1877.           to SAY(0) and so must be used in conjunction with 
  1878.           the latter.
  1879.         - Usage of the SAY function is typically like this:
  1880.  
  1881.             SAY ...        '..start asynchronous speech
  1882.  
  1883.             WHILE SAY(0)
  1884.               x = SAY(1)
  1885.               y = SAY(2)
  1886.               .
  1887.                .
  1888.             WEND
  1889.         
  1890. --------------------------------------------------------------------------------
  1891. SCREEN        - The SCREEN statement syntax is the same as in AmigaBASIC:
  1892.  
  1893.             SCREEN screen-id,width,height,depth,mode
  1894.  
  1895.           where mode is one of the following:
  1896.  
  1897.           1 = lores
  1898.           2 = hires
  1899.           3 = lores,interlaced
  1900.           4 = hires,interlaced.
  1901.            5 = HAM (hold-and-modify)    [ACE only]
  1902.           6 = extra-halfbrite        [ACE only]
  1903.  
  1904.         - See also ERR.
  1905.  
  1906.  
  1907.         - The SCREEN function (ACE only) syntax is SCREEN(n), where:
  1908.  
  1909.           SCREEN(0) - Returns a pointer to the Intuition window,
  1910.                   that is, the current output window or default
  1911.                   window for the screen.
  1912.  
  1913.           SCREEN(1) - Returns a pointer to the Intuition screen.
  1914.  
  1915.           SCREEN(2) - Returns a pointer to the rastport of
  1916.                   the default window or current output 
  1917.                   window for the screen.    
  1918.  
  1919.           SCREEN(3) - Returns a pointer to the screen's viewport.
  1920.  
  1921.           SCREEN(4) - Returns a pointer to the screen's bitmap.
  1922.  
  1923.           SCREEN(5) - Returns the width of the screen's font.
  1924.  
  1925.           SCREEN(6) - Returns the height of the screen's font.
  1926.  
  1927.         - A future revision of ACE's SCREEN command will support
  1928.           AGA screen modes.
  1929.  
  1930. --------------------------------------------------------------------------------
  1931. SCREEN BACK    - syntax: SCREEN BACK screen-id
  1932.         - Sends the specified screen to the back of the display.
  1933.  
  1934. --------------------------------------------------------------------------------
  1935. SCREEN CLOSE    - syntax: SCREEN CLOSE screen-id
  1936.         - Closes a single screen. 
  1937.  
  1938. --------------------------------------------------------------------------------
  1939. SCREEN FORWARD    - syntax: SCREEN FORWARD screen-id
  1940.         - Makes the specified screen frontmost.
  1941.  
  1942. --------------------------------------------------------------------------------
  1943. SCROLL        - syntax: SCROLL (xmin,ymin)-(xmax,ymax),delta-x,delta-y
  1944.         - Scrolls bits inside the specified rectangle.
  1945.         - Delta-x and delta-y specify motion right and down 
  1946.           respectively.
  1947.         - Negative delta values produce motion to the left and up.
  1948.  
  1949. --------------------------------------------------------------------------------
  1950. SERIAL *    - syntax: SERIAL(channel,n)
  1951.      
  1952.           where channel is a serial channel identifier from 1..255 
  1953.           and n is a function number from 0..12 (see below).
  1954.  
  1955.         - This function returns information about an open serial 
  1956.           channel.
  1957.         
  1958.           n value
  1959.           -------
  1960.  
  1961.           0    - Returns the number of characters in the serial
  1962.               read buffer. Use this value to determine how many
  1963.               bytes to read from the buffer (see SERIAL READ).
  1964.  
  1965.           1    - Unit number of serial device in use by this channel
  1966.               (see SERIAL OPEN).
  1967.  
  1968.           2    - Baud rate.
  1969.  
  1970.           3    - Parity. Actually the ASCII value of the character
  1971.               representing the selected parity (N,E,O,M,S). Use
  1972.               CHR$ function to recover the character.
  1973.  
  1974.           4    - Number of data bits.
  1975.  
  1976.           5    - Number of stop bits.
  1977.  
  1978.           6    - Number of wires for handshaking: 3 or 7.
  1979.  
  1980.           7    - XON/XOFF feature: 0=disabled; 1=enabled.
  1981.  
  1982.           8     - Shared access mode: 0=disabled; 1=enabled.
  1983.  
  1984.           9    - Fast mode: 0=disabled; 1=enabled.
  1985.  
  1986.          10    - Serial (read) buffer size in bytes.
  1987.  
  1988.          11    - Name of serial device. Actually, the value returned
  1989.               is the address in memory of the name string. Use
  1990.               ACE's CSTR function to convert it to a string.    
  1991.         
  1992.          12    - A 16-bit word representing the status of the serial 
  1993.               port lines and registers.
  1994.  
  1995.               Bit    Active    Symbol    Function
  1996.               ---    ------    ------    --------
  1997.               0    -        Reserved
  1998.               1    -        Reserved
  1999.               2    high    (RI)    Parallel Select on A1000
  2000.                         + Ring-indicator on A500/A2000
  2001.               3    low    (DSR)    Data Set Ready
  2002.               4    low    (CTS)    Clear To Send
  2003.               5    low    (CD)    Carrier Detect
  2004.               6    low    (RTS)    Ready To Send
  2005.               7    low    (DTR)    Data Terminal Ready
  2006.               8    high        Read overrun
  2007.               9    high        Break sent
  2008.              10    high        Break received    
  2009.              11    high        Transmit x-OFFed
  2010.              12    high        Receive x-OFFed
  2011.              13    -        Reserved
  2012.              14    -        Reserved
  2013.              15    -        Reserved
  2014.  
  2015.              If you wanted to test for Carrier Detect, code 
  2016.              such as:
  2017.  
  2018.                 carrier_detect = SERIAL(1,12) AND 32
  2019.  
  2020.              would store 32 in carrier_detect if CD was high
  2021.              (ie. no carrier) and 0 if CD was low (ie. carrier
  2022.              detected). The value 32 is used here since CD is
  2023.              associated with bit 5 and 2^5 is 32. The 1 here
  2024.              means serial channel 1.
  2025.          
  2026.              Note that the above status word is taken directly
  2027.              from querying the serial device associated with a
  2028.              particular channel and the above table is taken
  2029.              directly from the ROM Kernel Ref. Manual: Devices,
  2030.              (1991), pg 278.
  2031.  
  2032.         - For more information about the serial device modes etc, 
  2033.           see SERIAL OPEN command below and Commodore's ROM Kernel 
  2034.           Reference Manual: Devices.
  2035.         - See also ERR.
  2036.  
  2037. --------------------------------------------------------------------------------
  2038. SERIAL CLOSE *    - syntax: SERIAL CLOSE [#] channel
  2039.         - Closes a logical channel to a serial device.
  2040.         - See also ERR.
  2041.     
  2042. --------------------------------------------------------------------------------
  2043. SERIAL OPEN *    - syntax: SERIAL OPEN [#]channel,unit,baud,params[,size][,dev]
  2044.  
  2045.         - This command opens a logical channel to a serial device.
  2046.         - The channel parameter must be in the range 1..255.
  2047.         - The unit parameter tells ACE which serial device unit to
  2048.           open (eg: for a multi-port serial card). Normally however,
  2049.           you should specify 0 for a single serial port.
  2050.         - The baud rate is specified by the baud parameter. This value
  2051.           can be in the range 110..292,000 on the Amiga.
  2052.  
  2053.         - The next parameter is a string consisting of at least three 
  2054.           single character "switches":
  2055.  
  2056.             parity         - N,E,O,M or S. Other = N.
  2057.             data bits    - usually 7 or 8.
  2058.             stop bits    - usually 1 or 2.
  2059.  
  2060.             wires        - 3 or 7. Other = 7.
  2061.             XON/XOFF    - X = enabled. Other = disabled.
  2062.             Access        - S = shared. Other = exclusive. 
  2063.             Fast mode    - F = fast mode. Other = normal.
  2064.         
  2065.         - Parity, data bits and stop bits MUST be specified and 
  2066.           in the order shown above, while the remaining switches 
  2067.           are optional and can be given in any order. 
  2068.         - Fast mode is intended for use in conjunction
  2069.           with peripherals which require high serial 
  2070.           throughput, eg. a MIDI device. Higher throughput
  2071.           is achieved by certain internal serial device checks
  2072.           being skipped. Fast mode should be used only when:
  2073.           parity checking has been disabled, XON/XOFF handling 
  2074.           is disabled and 8 bit characters are in use.
  2075.         - For a letter, upper or lower case can be used.
  2076.         - In the above description of switches "Other" means any
  2077.           other character (I suggest you use "?" or some other
  2078.           character consistently, to indicate "don't care").
  2079.  
  2080.         - The optional parameter "size" specifies the size of the 
  2081.           serial *read* buffer. At high baud rates the buffer can 
  2082.           fill up quickly. The default is 512 bytes.
  2083.         - The final parameter (dev) is also optional. This specifies
  2084.           the name of the serial device to be used. The device name
  2085.           defaults to "serial.device" if not specified. An alternate
  2086.           serial device can be used as long as the device's commands
  2087.           are compatible with the standard serial.device supplied with
  2088.            the Amiga. This device normally lives in the DEVS: directory.
  2089.         - If using another serial device, simply supply its name
  2090.           if it resides in the DEVS: directory, otherwise a full 
  2091.           path must be specified.
  2092.  
  2093.         - Here's a typical example of SERIAL OPEN usage:
  2094.  
  2095.               SERIAL OPEN 1,0,2400,"N81",1024
  2096.  
  2097.           which opens a channel (#1) to the standard serial device
  2098.           with a baud rate of 2400, no parity, 8 data bits and 1
  2099.           stop bit. All 7 wires will be used for handshaking and
  2100.           the serial read buffer size will be set to 1K.
  2101.         - See also ERR.
  2102.           
  2103. --------------------------------------------------------------------------------
  2104. SERIAL READ *    - syntax: SERIAL READ [#] channel,buffer,length           
  2105.         - Tells ACE to read length bytes from the serial buffer
  2106.           corresponding to the (open) logical channel into a string
  2107.           buffer.
  2108.         - The buffer can be a string variable or array.
  2109.         - Note that this command will wait for the serial port
  2110.           read to complete before returning control to your program,
  2111.           so use SERIAL(channel,0) to find out how many bytes are
  2112.           waiting on the port and make length equal to that value.
  2113.          - See also ERR.
  2114.  
  2115. --------------------------------------------------------------------------------
  2116. SERIAL WRITE *    - syntax: SERIAL WRITE [#] channel,string,length       
  2117.         - Tells ACE to write length bytes to the serial port
  2118.           corresponding to the (open) logical channel from a 
  2119.           string buffer.
  2120.         - The string buffer can be any string expression.
  2121.         - See also ERR.
  2122.                  
  2123. --------------------------------------------------------------------------------
  2124. SETHEADING *     - syntax: SETHEADING n
  2125.         - Changes the turtle's heading to n degrees.
  2126.  
  2127. --------------------------------------------------------------------------------
  2128. SETXY *        - syntax: SETXY x,y
  2129.         - Sets the x,y location for the next graphics command
  2130.           in the current output window or open screen.
  2131.         - Its primary use is for turtle graphics. To prevent the 
  2132.           "turtle" drawing a line when SETXY is used, the PENUP 
  2133.           command should first be issued.
  2134.  
  2135. --------------------------------------------------------------------------------
  2136. SGN        - syntax: SGN(n)
  2137.         - Returns the sign of the number n:
  2138.  
  2139.             if n>0, SGN(n) returns  1
  2140.             if n=0, SGN(n) returns  0
  2141.             if n<0, SGN(n) returns -1
  2142.  
  2143. --------------------------------------------------------------------------------
  2144. SHARED        - syntax: SHARED <ident>[,<ident> ... ]
  2145.         - Variables, arrays and structures must explicitly
  2146.           be shared between the main program and subprograms.
  2147.         - Only EXTERNAL variables are exempt from such sharing in
  2148.           ACE since they are global (see "Identifiers" in ace.doc).
  2149.         - One or more SHARED statements can appear in a subprogram
  2150.           and are usually placed before all other code in that SUB.
  2151.         - Declarations of objects to be shared must appear in the 
  2152.           main program before the subprogram is *declared*.
  2153.         - See subprograms section in ace.doc and the entry for
  2154.           DIM above re: DIM SHARED.
  2155.  
  2156. --------------------------------------------------------------------------------
  2157. SHL *        - syntax: SHL(n,m) 
  2158.           where n is the value to be shifted and m is the number 
  2159.           of bit positions to shift.        
  2160.         - Arithmetic shift left function. Returns a long integer. 
  2161.         - Shifting left by 1 bit (or more) is faster than multiplying 
  2162.           by 2 (or powers thereof).  
  2163.  
  2164. --------------------------------------------------------------------------------
  2165. SHR *        - syntax: SHR(n,m) 
  2166.           where n is the value to be shifted and m is the number 
  2167.           of bit positions to shift. 
  2168.         - Arithmetic shift right function. Returns a long integer.
  2169.         - Shifting right by 1 bit (or more) is faster than dividing 
  2170.           by 2 (or powers thereof).  
  2171.  
  2172. --------------------------------------------------------------------------------
  2173. SHORTINT *    - syntax: SHORTINT <identifier>[,..]
  2174.         - Declares and initialises one or more short integer 
  2175.           variables.
  2176.  
  2177. --------------------------------------------------------------------------------
  2178. SINGLE *    - syntax: SINGLE <identifier>[,..]
  2179.         - Declares and initialises one or more single-precision 
  2180.           variables.
  2181.  
  2182. --------------------------------------------------------------------------------
  2183. SIZEOF *    - syntax: 
  2184.           SIZEOF(byte|shortint|longint|address|single|string|<ident>)
  2185.           where <ident> is the name of a variable, array, structure
  2186.           type or structure variable (not a SUB, function or external
  2187.           variable).
  2188.         - A size in bytes is returned.
  2189.         - The intention is the same as that of C's sizeof() operator.
  2190.         - SIZEOF is most useful when allocating memory for structures.
  2191.  
  2192. --------------------------------------------------------------------------------
  2193. SIN        - syntax: SIN(n)
  2194.         - Returns the sine of n.
  2195.  
  2196. --------------------------------------------------------------------------------
  2197. SLEEP        - syntax: SLEEP
  2198.         - This command puts a program to sleep until there is 
  2199.           mouse, menu or keyboard activity. The program will
  2200.           also be woken up by IntuiTicks (timer signals from a
  2201.           user-defined window or default screen window) at regular 
  2202.           intervals (every ~0.1 of a second) so your program can 
  2203.           perform other tasks.
  2204.         - If SLEEP is called when the current output window is
  2205.           a CLI/shell, SLEEP returns control to your program 
  2206.           immediately.
  2207.         - Once a window loses the "focus" SLEEP waits indefinitely.
  2208.           If this is likely to happen, you might want to use the 
  2209.           SLEEP FOR command instead.
  2210.  
  2211. --------------------------------------------------------------------------------
  2212. SLEEP FOR *    - syntax: SLEEP FOR <seconds>
  2213.         - Suspends execution of a program for the specified number
  2214.           of seconds, which can be a single-precision floating point
  2215.           value greater than 0 (including values between 0 and 1).
  2216.         - This command does NOT use a busy waiting method. Instead
  2217.           it relies upon the dos.library Delay() function to delay
  2218.           execution in a system-friendly way, without hogging CPU 
  2219.           time.
  2220.         - The smallest practical value for <seconds> is 0.02 since
  2221.           there are 50 ticks per second and 50*0.02 = 1 tick. Any
  2222.           value less than 0.02 will therefore cause SLEEP FOR to
  2223.           return immediately. This would have the same effect as
  2224.           busy waiting which hogs CPU time. To see the effect of
  2225.           various values of <seconds> run the following program
  2226.           with the system tool PerfMon running:
  2227.  
  2228.             WHILE INKEY$=""
  2229.               SLEEP FOR n        '..where n is <seconds>
  2230.             WEND
  2231.  
  2232.         - You should notice that as <seconds> approaches zero,
  2233.           CPU time looks more like it would if you had used
  2234.           the above loop without SLEEP FOR at all.
  2235.  
  2236. --------------------------------------------------------------------------------
  2237. SOUND        - syntax: SOUND period,duration[,volume][,voice]
  2238.         - Note that the syntax of this command is different
  2239.           from the equivalent statement in AmigaBASIC.
  2240.         - See the sound section in ace.doc for details.
  2241.         - See also the WAVE command. A combination of
  2242.           these two commands in ACE allows you to easily
  2243.           play sound samples (see example program play.b).
  2244.         - SOUND currently uses the audio hardware directly
  2245.           but a future enhanced version will use the audio device.
  2246.  
  2247. --------------------------------------------------------------------------------
  2248. SPACE$        - syntax: SPACE$(n)
  2249.         - Returns a string of n spaces.
  2250.  
  2251. --------------------------------------------------------------------------------
  2252. SPC        - syntax: SPC(n)
  2253.         - This function is generally used in conjunction with PRINT
  2254.           and returns a string of n spaces, where n is a value from
  2255.           0 to 255.
  2256.   
  2257. --------------------------------------------------------------------------------
  2258. SQR        - syntax: SQR(n)
  2259.         - Returns the square root of n.
  2260.         - The argument n must be >= 0.
  2261.  
  2262. --------------------------------------------------------------------------------
  2263. STICK        - syntax: STICK(n)
  2264.         - Returns information about joystick direction.
  2265.         - At the moment, STICK(0) & STICK(1) always return 0,
  2266.           while STICK(2) & STICK(3) return the state of
  2267.           the joystick in port 2 (B), where:
  2268.  
  2269.             STICK(2) is joystick B in X direction.
  2270.             STICK(3) is joystick B in Y direction.
  2271.         
  2272.         - Return values are:
  2273.  
  2274.              0 = joystick is not engaged.
  2275.              1 = movement is upward or to the right.
  2276.             -1 = movement is downward or to the left.
  2277.         - STICK currently goes straight to the hardware. A future
  2278.           revision may use the gameport device.    
  2279.  
  2280. --------------------------------------------------------------------------------
  2281. STOP        - This is functionally equivalent to END in ACE.
  2282.         - See also IF..[ELSE]..END IF.
  2283.  
  2284. --------------------------------------------------------------------------------
  2285. STR$        - syntax: STR$(n)
  2286.         - Returns the string representation of the numeric value n.
  2287.          - The string includes a leading space or "-" depending upon
  2288.           the sign of the number.
  2289.  
  2290. --------------------------------------------------------------------------------
  2291. STRIG        - syntax: STRIG(n)
  2292.         - Returns information about the state of a joystick button.
  2293.         - At the moment, STRIG(0), STRIG(1) & STRIG(2) always
  2294.           return 0. 
  2295.         - STRIG(3) returns -1 if the port 2 joystick's
  2296.           fire button is *currently* pressed and 0 if it isn't.
  2297.         - STRIG currently goes straight to the hardware. A future
  2298.           revision may use the gameport device.    
  2299.  
  2300. --------------------------------------------------------------------------------
  2301. STRING *    - syntax: STRING <ident> [[ADDRESS <addr>] | [SIZE <size>]][,..]
  2302.         - Declares and initialises one or more string variables
  2303.           with an optional size or address. If the size is not 
  2304.           specified, a length of MAXSTRINGLEN bytes is assumed.
  2305.         - If an address is specified, the SIZE option can't be used
  2306.           since the size of the area of memory pointed to by <addr>
  2307.           has already been determined.
  2308.  
  2309. --------------------------------------------------------------------------------
  2310. STRING$        - syntax: STRING$(I,J) or STRING(I,X$).
  2311.         - STRING$ returns a string of length I consisting of characters
  2312.           with ASCII code J or ASC(MID$(X$,1,1)).
  2313.  
  2314. --------------------------------------------------------------------------------
  2315. STRUCT *    - Defines a new structure data type, thus:
  2316.  
  2317.           STRUCT <ident>
  2318.             <type> <ident1>
  2319.             <type> <ident2>
  2320.             .
  2321.             .
  2322.             <type> <identN>
  2323.           END STRUCT
  2324.  
  2325.           where <type> can be BYTE,SHORTINT,LONGINT,ADDRESS,SINGLE,
  2326.           STRING and <ident1>..<identN> are structure members of one
  2327.           of these data types.
  2328.         - A structure member may also be another structure. In this
  2329.           case, <type> must be the name of a previously defined 
  2330.           structure type. See ace.doc's "Structures" section for 
  2331.           more about this.
  2332.         - Where a member is of type STRING, an optional size can be
  2333.           specified (STRING <ident> [SIZE <size>]).
  2334.         - See also: DECLARE and the section on structures in ace.doc.
  2335.         - Structures have been provided in ACE primarily to make
  2336.           communicating with the operating system a little nicer
  2337.           and to make dynamic data structures possible (see the
  2338.           example programs turtle/bst.b and misc/linkedlist.b).
  2339.         - ACE structures cannot currently be array elements although
  2340.           there is nothing to stop you from storing structure start
  2341.           addresses in array elements. For an example of this, see  
  2342.           prgs/misc/array_of_structs.b.
  2343.         - See "Structures" section in ace.doc for more details.
  2344.             
  2345. --------------------------------------------------------------------------------
  2346. STYLE *        - syntax: STYLE n
  2347.         - Changes the text style for the current output window
  2348.           (user-defined window or shell).
  2349.         - The single parameter can take on the following values:
  2350.  
  2351.           n    Effect
  2352.           -    ------
  2353.           0    Plain
  2354.           1    Underlined
  2355.           2    Bold
  2356.           4    Italic
  2357.           8    Extended width    (non-shell/CLI window only)
  2358.  
  2359.         - These values can be added to produce cumulative effects
  2360.           (eg: n=3 gives bold and underlined text).
  2361.  
  2362. --------------------------------------------------------------------------------
  2363. SUB..END SUB    - syntax: 
  2364.  
  2365.           SUB [<type>] <ident> [([<type>] <param> [..])] [EXTERNAL]
  2366.               <statement1>
  2367.                 <statement2>
  2368.                 .
  2369.                 .
  2370.                 <statementN>    
  2371.           END SUB
  2372.  
  2373.           where the optional <type> is one of: LONGINT,ADDRESS,
  2374.           SHORTINT,SINGLE or STRING.    
  2375.         - In ACE, subprograms are non-static, allow recursion, may 
  2376.           have return values and have optional parameter lists.
  2377.         - Parameters are call-by-value but ACE does provide mechanisms
  2378.           for call-by-reference parameters.
  2379.         - SHARED variables are supported in ACE (see SHARED command). 
  2380.         - Note that since ACE SUBs are non-static, the STATIC keyword
  2381.           is not allowed.
  2382.         - The optional EXTERNAL keyword makes the subprogram 
  2383.           visible to other ACE modules. 
  2384.         - See "Subprograms" section in ace.doc for more details.
  2385.  
  2386. --------------------------------------------------------------------------------
  2387. SWAP        - syntax: SWAP <object>,<object>
  2388.           where <object> is a simple/external variable, parameter,
  2389.           array element, structure or structure member.
  2390.         - This command swaps the value of the specified data objects.
  2391.         - SWAP is not intended to be used for exchanging two whole 
  2392.           arrays.
  2393.         - ACE currently assumes a maximum length of MAXSTRINGLEN
  2394.           when swapping strings.
  2395.  
  2396. --------------------------------------------------------------------------------
  2397. SYSTEM        - syntax 1: SYSTEM n
  2398.           where n is an integer exit value (return code).
  2399.         - SYSTEM causes an ACE program to exit with the specified
  2400.           return code. The latter can be tested in a shell script
  2401.           as WARN, ERROR etc. This value is hidden from a Workbench
  2402.           launched program. 
  2403.         - Note that in AmigaBASIC, SYSTEM returns from the interpreter
  2404.           to the shell/CLI or Workbench. The same is true in ACE, 
  2405.           except that END and STOP will also do this, so SYSTEM's
  2406.           intended purpose in ACE is different to that in AmigaBASIC.
  2407.  
  2408.     OR
  2409.  
  2410.         - syntax 2: SYSTEM command-string
  2411.         - This version of the SYSTEM command attempts to run a 
  2412.           shell/CLI command. It is equivalent to the following
  2413.           dos.library command: Execute(command-string,stdin,stdout).
  2414.         - If the command writes to standard output, make sure you 
  2415.           are running the program from a shell/CLI or at least
  2416.           that you have given the EXTERNAL stdout variable a valid
  2417.           value corresponding to an open file's handle, typically a 
  2418.           CON: or RAW: window (see HANDLE function).
  2419.         - Also, make sure that "Run" is in your C: directory.
  2420.         - Examples:
  2421.  
  2422.             SYSTEM "list"       '..lists files in current directory
  2423.  
  2424.             SYSTEM "dir > fred" '..runs dir command and redirects
  2425.                     '..output to a file called fred.
  2426.  
  2427.     OR
  2428.  
  2429.         - syntax 3: SYSTEM
  2430.         - This *function* returns the Exec library version, enabling
  2431.           your program to do different things depending upon the 
  2432.           version of the operating system under which it is running.
  2433.         - A value of 34 indicates Workbench 1.3 while 37 indicates
  2434.           Workbench 2.04.
  2435.  
  2436. --------------------------------------------------------------------------------
  2437. TAB        - syntax: TAB(n)
  2438.         - Used in conjunction with PRINT to move the print position
  2439.           to the nth column.
  2440.         - TAB(n) - where n=1..81. 
  2441.         - if n>81, wraparound will occur in a DOS window while
  2442.           a user-defined (Intuition) window/screen will clip any 
  2443.           output past the last character position.
  2444.         - if n<1, the next print position will be column 1 (leftmost).  
  2445.  
  2446. --------------------------------------------------------------------------------
  2447. TAN        - syntax: TAN(n)
  2448.         - Returns the tangent of n.
  2449.  
  2450. --------------------------------------------------------------------------------
  2451. TIME$        - syntax: TIME$
  2452.         - Returns the current time as a string of the format:
  2453.  
  2454.             hh:mm:ss
  2455.  
  2456.           where hh is hours, mm is minutes and ss is seconds.
  2457.  
  2458. --------------------------------------------------------------------------------
  2459. TIMER        - syntax: TIMER
  2460.         - Returns a single-precision value corresponding to 
  2461.           seconds elapsed since midnight.
  2462.  
  2463. --------------------------------------------------------------------------------
  2464. TIMER ON ..    - syntax: TIMER ON|OFF|STOP 
  2465.         - These commands are used for enabling, disabling and 
  2466.           suspending ON TIMER(n) event trapping.
  2467.         - See the Event Trapping section in ace.doc.
  2468.         
  2469. --------------------------------------------------------------------------------
  2470. TRANSLATE$    - syntax: TRANSLATE$(<string-expression>)
  2471.         - Returns the phoneme-string equivalent of <string-expression> 
  2472.           where the latter contains words.
  2473.  
  2474. --------------------------------------------------------------------------------
  2475. TURN *        - syntax: TURN n
  2476.         - Rotates the turtle by n degrees.
  2477.         - If n is negative, the turtle will rotate counter-clockwise
  2478.           while if it is positive, the rotation will be clockwise.
  2479.  
  2480. --------------------------------------------------------------------------------
  2481. TURNLEFT *    - syntax: TURNLEFT n
  2482.         - Rotates the turtle counter-clockwise by n degrees.
  2483.         - If n is negative, the result will be the same as
  2484.           TURNRIGHT ABS(n).    
  2485.     
  2486. --------------------------------------------------------------------------------
  2487. TURNRIGHT *    - syntax: TURNRIGHT n
  2488.         - Rotates the turtle clockwise by n degrees.
  2489.         - If n is negative, the result will be the same as
  2490.           TURNLEFT ABS(n).    
  2491.  
  2492. --------------------------------------------------------------------------------
  2493. UCASE$        - syntax: UCASE$(<string-expression>)
  2494.         - Returns <string-expression> with all alphabetic characters 
  2495.           in upper case. 
  2496.  
  2497. --------------------------------------------------------------------------------
  2498. VAL        - syntax: VAL(X$)
  2499.         - Returns the numeric value of X$ as a single-precision
  2500.           number.
  2501.         - The translation of integers plus fixed-point and exponential
  2502.           format single-precision values is supported.
  2503.         - The hexadecimal and octal prefixes (&H and &O) are also 
  2504.           recognised by VAL.
  2505.         - VAL strips off leading whitespace (eg: spaces, tabs).
  2506.          - There may be a loss of accuracy if the string contains a 
  2507.           LARGE long integer value, due to the limitations of the 
  2508.           single-precision numeric format. To overcome this, use 
  2509.           the LONGINT(n) function.
  2510.  
  2511. --------------------------------------------------------------------------------
  2512. VARPTR        - syntax: VARPTR(<data-object>)
  2513.         - Returns the absolute address of a numeric variable, 
  2514.           string, array, array element, structure, structure 
  2515.           member, external function or subprogram.
  2516.         - You can safely use VARPTR to find a string variable's 
  2517.           address (SADD has also been provided for string variables
  2518.           and expressions).
  2519.         - Unlike AmigaBASIC, an object's address does not move 
  2520.           around in memory once allocated.
  2521.         - In ACE, the symbol "@" can be used instead of VARPTR, 
  2522.  
  2523.               eg: addr& = @n(2) '..finds address of an array element 
  2524.  
  2525.         - When used in conjunction with a structure variable x, 
  2526.           @x will return the address of the variable itself, NOT 
  2527.           the start address of the structure (see "Structures" in
  2528.           ace.doc for more).
  2529.         - See also section on indirection operators in ace.doc.
  2530.  
  2531. --------------------------------------------------------------------------------
  2532. WAVE        - syntax: WAVE voice,SIN | [waveform-address,byte-count]
  2533.         - Defines a waveform of any length to be used by the SOUND 
  2534.           statement for a specified audio channel (voice: 0..3).
  2535.         - If the SIN option is used, a sine waveform table is 
  2536.           allocated to the specified channel. This is the default
  2537.           waveform for the SOUND statement.
  2538.         - Unlike AmigaBASIC, the number of bytes in the waveform 
  2539.           table must be specified when SIN is not used.
  2540.         - See also the Sound section in ace.doc.
  2541.         
  2542. --------------------------------------------------------------------------------
  2543. WHILE..WEND    - syntax: WHILE <condition>
  2544.               .
  2545.               .
  2546.               WEND
  2547.  
  2548.           where <condition> is an expression which reduces
  2549.           to a boolean (true/false) value.
  2550.  
  2551.         - Statements inside the WHILE and WEND are executed
  2552.           while the <condition> is true (ie: non-zero).    
  2553.     
  2554. --------------------------------------------------------------------------------
  2555. WINDOW        - syntax:
  2556.           WINDOW id,[title-string],(x1,y1)-(x2,y2)[,type][,screen-id]
  2557.  
  2558.           where screen-id specifies the screen to which the window
  2559.           should be attached and type can be a combination of the 
  2560.           following (31 is the default if type is not specified):
  2561.  
  2562.             Type        Effect
  2563.             ----        ------
  2564.             1        Window size can be changed via
  2565.                     sizing gadget.
  2566.  
  2567.             2        Window can be moved about using
  2568.                     the title bar.
  2569.  
  2570.             4        Window can be moved from front to
  2571.                     back using the Back gadget.
  2572.                     
  2573.             5        Under Release 2.x of the OS, when
  2574.                     this Type value is specified alone
  2575.                     or as a component of larger Type 
  2576.                     value (eg: 7,15,23) a zoom gadget 
  2577.                     is added to the window allowing it 
  2578.                     to be switched between the two most 
  2579.                     recent window sizes.
  2580.  
  2581.             8        Close gadget added to window.
  2582.                     
  2583.             16        Contents of window reappear after
  2584.                     it has been covered.
  2585.     
  2586.             32        Window will be borderless.
  2587.  
  2588.         - The window-id must be from 1 to 9.
  2589.         - Note that if the rectangle as specified in the WINDOW 
  2590.           command is too large (according to screen mode), the 
  2591.           window won't open. 
  2592.         - See also ERR.
  2593.                 
  2594.     OR
  2595.  
  2596.         - syntax: WINDOW(n)
  2597.         - This function returns information related to ACE windows.
  2598.          
  2599.           WINDOW(0)  - window-id of the selected output window.
  2600.           WINDOW(1)  - window-id of current output window.
  2601.           WINDOW(2)  - present width of current output window.
  2602.           WINDOW(3)  - present height of current output window.
  2603.           WINDOW(4)  - x-coordinate in current output window where 
  2604.                    next pixel will be plotted.
  2605.           WINDOW(5)  - y-coordinate in current output window where 
  2606.                    next pixel will be plotted.
  2607.             WINDOW(6)  - max legal colour-id for current output window.
  2608.           WINDOW(7)  - pointer to Intuition Window for current output 
  2609.                    window.
  2610.           WINDOW(8)  - pointer to Rastport of current output window.
  2611.           WINDOW(9)  - pointer to AmigaDOS file handle for current 
  2612.                    output window (non-zero for shell/CLI only).
  2613.           WINDOW(10) - foreground pen in current output window.
  2614.           WINDOW(11) - background pen in current output window.
  2615.           WINDOW(12) - font width for current output window.
  2616.           WINDOW(13) - font height for current output window.
  2617.  
  2618.         - See the section on Windows in ace.doc for more details.  
  2619.  
  2620. --------------------------------------------------------------------------------
  2621. WINDOW CLOSE    - syntax: WINDOW CLOSE id
  2622.         - Closes the id'th window if it is open.
  2623.  
  2624. --------------------------------------------------------------------------------
  2625. WINDOW ON .. *    - syntax: WINDOW ON|OFF|STOP 
  2626.         - These commands are used for enabling, disabling and 
  2627.           suspending ON WINDOW event trapping.
  2628.         - See the Event Trapping section in ace.doc.
  2629.  
  2630. --------------------------------------------------------------------------------
  2631. WINDOW OUTPUT     - syntax: WINDOW OUTPUT id 
  2632.         - Makes the id'th open window the current output window.
  2633.  
  2634. --------------------------------------------------------------------------------
  2635. WRITE        - syntax: WRITE #filenumber,expression-list
  2636.           where filenumber corresponds to an open file.
  2637.         - The expression-list can contain any combination
  2638.           of data items (constants, variables) of any type
  2639.           separated by commas.
  2640.         - Note that the form of WRITE allowing for screen
  2641.           output is not supported by ACE.
  2642.         - See PRINT# re: the treatment of CHR$(0) in file I/O by ACE. 
  2643.         - See also INPUT# and the section on files in ace.doc. 
  2644.          - See also ERR.
  2645.  
  2646. --------------------------------------------------------------------------------
  2647. XCOR *        - Returns the turtle's current x-coordinate.
  2648.  
  2649. --------------------------------------------------------------------------------
  2650. YCOR *        - Returns the turtle's current y-coordinate.
  2651.  
  2652. --------------------------------------------------------------------------------
  2653. XOR        - Boolean operator: X XOR Y.
  2654.  
  2655.             X Y    Out
  2656.             -----------
  2657.             T T    F
  2658.             T F    T
  2659.             F T    T
  2660.             F F    F
  2661.