home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d969 / ace.lha / ACE / ACE-2.0.lha / DOCS.LHA / ref.doc < prev    next >
Text File  |  1994-01-19  |  89KB  |  2,167 lines

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