home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / multimedia / scala / install / DOC / SCRIPT.TXT < prev   
Encoding:
Text File  |  1996-05-15  |  136.2 KB  |  3,842 lines

  1. Contents:
  2.  
  3. 1.  The ScalaScript Language
  4. 2.  Sound EX Script Commands and Variables
  5. 3.  Input EX Script Commands
  6. 4.  Time Script Functions and Variables
  7. 5.  MPEG EX Script Commands
  8. 6.  Screen EX Script Commands and Variables
  9.  
  10.  
  11.  
  12.  
  13. -------------------------------------------------------------------------------
  14.  
  15. 1.  The ScalaScript Language
  16. ============================
  17.  
  18. This is a discussion of the ScalaScript language and its usage.
  19.  
  20. It is important to understand that the ScalaScript language is not a
  21. traditional procedural (imperative) programming language. Commands in
  22. a ScalaScript script are not necessarily executed one after another,
  23. like a Basic or C program. Rather, a ScalaScript script is a
  24. description of an application and its components, much like a
  25. description in English. The ScalaScript parser and the EX modules read
  26. this description and build a model that can be used to play or author
  27. the script.
  28.  
  29. Also, keep in mind that the ScalaScript language was designed primarily to be
  30. authored in a graphical user interface. It would certainly look different if it
  31. was intended to be used as a programming language.
  32.  
  33. Example Scripts
  34. ---------------
  35.  
  36. First, a few sample scripts and their ScalaScript descriptions will be
  37. presented.
  38.  
  39. Simple Picture Sequence
  40. -----------------------
  41.  
  42. The first example script consists of four event objects; one Block that
  43. contains the full script and three atoms placed in the Block's Sequence list.
  44. In the ScalaScript language, this script could be described with the following
  45. lines:
  46.  
  47.     !ScalaScript
  48.     EVENT
  49.       Sequence:
  50.         PICTURE (":C/PICTURES/PICTURE1.BMP");
  51.         PICTURE (":C/PICTURES/PICTURE2.BMP");
  52.         PICTURE (":C/PICTURES/PICTURE3.BMP");
  53.     END
  54.  
  55. Note that the containing Block is often referred to as the "parent" of the
  56. Events that the Block contains, and that the Events within the Block are
  57. often referred to as "sub-events" of the Block.
  58.  
  59. Sub-events are by default placed in the parent Block's Sequence list. In this
  60. case, the PICTURE events must go into the Sequence list rather than the Group
  61. list. This is because events in the Group list are played in parallel, which
  62. doesn't make much sense for these events (they should be played sequentially).
  63. Since events default to the Sequence list, the Sequence: keyword is optional
  64. here.
  65.  
  66. The PICTURE command used here, which an example command supported by some
  67. external EX, requires one parameter: the name of the picture file. Note how
  68. command parameters are enclosed in parentheses. A file name is a string, which
  69. has to be enclosed in double quotes ("). Also note that the ScalaScript language
  70. can use MMOS syntax for path names, which is slightly different from MS-DOS.
  71. However, standard MS-DOS path names are supported.
  72.  
  73. As can be seen from the example, commands are terminated by semicolons (;).
  74.  
  75. Simple Page Sequence
  76. --------------------
  77.  
  78. The next example script uses Blocks to Group related events together:
  79.  
  80.     !ScalaScript
  81.     EVENT
  82.     Sequence:
  83.         :Page1 EVENT
  84.         Group:
  85.             PICTURE(":C/PICTURES/PICTURE1.BMP");
  86.         Sequence:
  87.             TEXT(120,40,"This is our");
  88.             TEXT(120,60,"first script");
  89.             TEXT(120,80,"with text");
  90.         END
  91.  
  92.         :Page2 EVENT
  93.         Group:
  94.             ANIM(":C/ANIM/ANIM1.FLC");
  95.             SOUND(":C/MUSIC/SONG1.MID");
  96.         Sequence:
  97.             TEXT(120,350,"You can put text on animations, too");
  98.         END
  99.     END
  100.  
  101. The EVENT...END commands are used to define Blocks.
  102.  
  103. Events may be named by proceeding them with a label. The label is an identifier
  104. that is prefixed by a colon. Note that this is an identifier, not a string.
  105. Identifiers must follow stricter rules than strings (see below).
  106.  
  107. The label attaches to the first event that follows its definition. Therefore,
  108. any label must precede some event. Note that certain commands contain internal
  109. labels and a label should not be placed before these commands. These commands
  110. are those that define named entities, such as variable declarations or style
  111. commands.
  112.  
  113. Also, note how the PICTURE, ANIM and SOUND commands are placed in their parents'
  114. Group list in this example. The items in a Group list are played in parallel and
  115. are active throughout the execution of the Block's Sequence list.
  116.  
  117. Simple Chapter Sequence
  118. -----------------------
  119.  
  120. The EVENT...END commands can be nested any number of levels:
  121.  
  122.     !ScalaScript
  123.     EVENT
  124.         :Chapter1 EVENT
  125.         Sequence:
  126.             :Page1 EVENT
  127.             Group:
  128.                 PICTURE(":C/PICTURES/PICTURE1.BMP");
  129.             Sequence:
  130.                 TEXT(120,40,"Some text");
  131.             END
  132.             :Page2 PICTURE(":C/PICTURES/PICTURE2.BMP");
  133.             :Page3 PICTURE(":C/PICTURES/PICTURE3.BMP");
  134.         END
  135.  
  136.         :Chapter2 EVENT
  137.             :Page1 EVENT
  138.             Group:
  139.                 PICTURE(":C/PICTURES/PICTURE4.BMP");
  140.             Sequence:
  141.                 TEXT(120,40,"Some text");
  142.             END
  143.         END
  144.     END
  145.  
  146. Note that it may not be desirable to nest the script a great deal, even though
  147. it is possible. Nested Blocks restrict the access to Events defined within
  148. them. It is often useful to be able to jump directly to any page from any point
  149. in the script. This is not possible if the script uses chapter nesting as shown
  150. above.
  151.  
  152. Lexical and Syntax Rules
  153. ------------------------
  154.  
  155. Since the arguments of most commands and functions, as well as the indices of
  156. many arrays, are parsed by EX modules, the Player cannot control the lexical
  157. rules in all instances. For instance, in these sample commands, arrays and
  158. functions the parsing within the parenthesis or square brackets is handled by
  159. the EX:
  160.  
  161.     mx129.play("test", rate(100), delay(long), start(true));
  162.     a = channel_value(1, 17, force(true)) + channel_offset[1, current_channel(true)];
  163.  
  164. It is assumed that EX implementors will follow the standards in all cases. Not
  165. doing so should be considered an error in the EX implementation.
  166.  
  167. ScalaScript File Identifier
  168. ---------------------------
  169.  
  170. The first 12 characters of a ScalaScript file must be "!ScalaScript" (without
  171. the quotes.) This identifies the file to the Player as a valid ScalaScript file.
  172. This keyword must be before any comments, commands, white space or any other
  173. characters. It must be on its own line (the first line of the file).
  174.  
  175. White Space and Comments
  176. ------------------------
  177.  
  178. The ScalaScript language ignores all white space, such as spaces, carriage
  179. returns, line feeds and tabs. Any string of these white space characters is
  180. treated as a single separator character in parsing. That is, this script:
  181.  
  182.     !ScalaScript
  183.     EVENT Group: integer(x); Sequence: x=x+1; END
  184.  
  185. Is equivalent to this script:
  186.  
  187.     !ScalaScript
  188.     EVENT
  189.     Group:
  190.         integer(x);
  191.     Sequence:
  192.         x=x+1;
  193.     END
  194.  
  195. There are two types of comments in ScalaScript: block comments and line
  196. comments. Block comments delimit a range of characters defined by a block
  197. comment introducer ("/*") and a block comment terminator ("*/"). All characters
  198. within a block comment are ignored including the block comment introducer and
  199. line comment introducer.
  200.  
  201.     !ScalaScript
  202.     /* this is a block comment */
  203.     Event
  204.     /* this is a comment.  It may appear anywhere within the file,
  205.     except on the first line.  The everything within the block is ignored.
  206.     */
  207.     End
  208.     /* another block comment */
  209.  
  210. Line comments are introduced by the line comment introducer ("//"). All
  211. characters following the line comment introducer up to the next end of line
  212. character are ignored.
  213.  
  214.     !ScalaScript
  215.     // this is a comment
  216.     Event
  217.     Sequence:                      // this is a comment.
  218.         my.command(1,2,test(on));  // another comment.
  219.     End
  220.     // this is a comment.
  221.  
  222. Comments do not nest.
  223.  
  224. Case
  225. ----
  226.  
  227. Scripts are case insensitive, that is "WHILE" is equivalent to "while".
  228.  
  229.     /* these three lines are equivalent */
  230.     DISPLAY(STYLE(DISPLAY1));
  231.     Display(Style(Display1));
  232.     display(style(display1));
  233.  
  234. Labels
  235. ------
  236.  
  237. Labels are defined by a leading colon.
  238.  
  239.     :cmd_label command();                   // command with label.
  240.     :my_event  event...end                  // block with label.
  241.  
  242. Labels can collide with other names (variables, styles, etc.).
  243.  
  244. Labels attach to the next event. Labels that do not have a following event are
  245. ignored (before END, 2 sequential labels).
  246.  
  247. Disable
  248. -------
  249.  
  250. Events (commands or blocks) may be disabled by placing the word "disabled"
  251. in front of them.  The "disabled" keyword follows any label, but preceeds the
  252. event or block.
  253.  
  254.     Disabled my_command(1, foo(on));        // disabled command.
  255.     :my_label disabled cmd();               // disabled command with label.
  256.     :my_event disabled event...end          // disabled block with label.
  257.  
  258. Identifiers
  259. -----------
  260.  
  261. Identifiers are used to denote command names and event names (including labels,
  262. variable names and function names.) Identifiers must start with one of the
  263. following characters:
  264.  
  265.     A-Z, a-z, _ (underscore)
  266.  
  267. Otherwise, an identifier can contain any number of the following characters:
  268.  
  269.     A-Z, a-z, _ (underscore), 0-9, . (dot)
  270.  
  271. Identifiers are not case-sensitive.
  272.  
  273. Numerals
  274. --------
  275.  
  276. Numeric literals can be in decimal, hexadecimal or binary form, for example:
  277.  
  278.     4711        (decimal)
  279.     $7f         (hexadecimal)
  280.     %11010111   (binary)
  281.  
  282. Numerals are 32-bit signed values. The decimal form uses a minus sign to denote
  283. negative numbers, while the hexadecimal and binary forms use twos-complement.
  284. Hexadecimal numbers are not case sensitive.
  285.  
  286. Strings
  287. -------
  288.  
  289. String literals are always enclosed with double quotes ("). ScalaScript imposes
  290. no limit to the length of a string.
  291.  
  292. The ScalaScript language uses the caret (^) as an "escape" character, to prefix
  293. control codes within a string:
  294.  
  295.     ^n    New Line
  296.     ^r    Carriage Return
  297.     ^t    Tab
  298.     ^"    Quote
  299.     ^^    Caret
  300.     ^     At end of line: continue string on next line
  301.     ^xNN  Embed any ASCII code NN (hexadecimal 00-FF)
  302.  
  303. Boolean
  304. -------
  305.  
  306. Boolean literals may be written in two forms:
  307.  
  308.     TRUE, FALSE
  309.     ON, OFF
  310.  
  311. With TRUE being equivalent to ON and FALSE being equivalent to OFF. The two
  312. forms may be used interchangeably.
  313.  
  314. Parenthesis, Separators and Terminators
  315. ---------------------------------------
  316.  
  317.     Parentheses   ( )   used to enclose command an function parameter lists.
  318.                         They are also used in expressions for grouping.
  319.     Brackets      [ ]   used to enclose index values of an array variable.
  320.     Commas        ,     used to separate parameters in a parameter list.
  321.     Semicolons    ;     used to terminate commands.
  322.     Colons        :     used with certain keywords and with labels.
  323.  
  324. Operators
  325. ---------
  326.  
  327. For the use in integer arithmetic expressions, the ScalaScript language
  328. recognizes the following operators:
  329.  
  330.     *    multiplication
  331.     **   Power
  332.     +    addition
  333.     -    subtraction or negation
  334.     /    division
  335.     =    assignment
  336.     MOD  Modulus
  337.  
  338. Boolean operators are:
  339.  
  340.     <    less-than
  341.     <=   less-than or equal-to
  342.     <>   not equal-to
  343.     =    equality
  344.     >    greater-than
  345.     >=   greater-than or equal-to
  346.     AND  logical and
  347.     NOT  logical not
  348.     OR   logical or
  349.  
  350. String operators are:
  351.  
  352.     +    Concatenation
  353.     =    Assignment
  354.  
  355. Expressions
  356. -----------
  357.  
  358. Primitives
  359. ----------
  360.  
  361. The ScalaScript language itself recognizes a few keywords - or primitives:
  362.  
  363.     {              Block introducer, equivalent to EVENT.
  364.     }              Block terminator, equivalent to END.
  365.     Boolean        Declare one or more Boolean variables.
  366.     Chain          Load and execute a script file. Never return.
  367.     Else           Conditional execution of the current Block if the
  368.                    preceding IF/ELSEIF returned FALSE.
  369.     ElseIf         Conditional execution of the current Block if the
  370.                    preceding IF/ELSEIF returned FALSE and condition evaluates
  371.                    to TRUE.
  372.     End            Block terminator, equivalent to }.
  373.     Event          Block introducer, equivalent to {.
  374.     EX             Open a specified EX.
  375.     Exit           Exit one or more Blocks.
  376.     GoTo           Goto a specified event by name. Pushes a return address
  377.                    (for the RETURN command) if Bookmark(TRUE) is specified
  378.                    as an option.
  379.     Group:         Place events that follow into the Group list of the
  380.                    current Block.
  381.     If             Conditional execution of the current Block if the
  382.                    condition evaluates to TRUE.
  383.     Integer        Declare one or more integer variables.
  384.     Jump           Jump a number of events forward or backward.
  385.     OnNotification Perform an action when a variable changes.
  386.     Quit           Exit a script and return to the caller (from
  387.                    Script command.)
  388.     Resources:     Place events that follow into the Resources list of the
  389.                    current Block.
  390.     Return         Return to the event following the last executed goto that
  391.                    pushed a bookmark. Only returns to GOTOs that set
  392.                    Bookmark(TRUE).
  393.     Script         Load and execute a script file. Continue in this file after
  394.                    loaded file exits.
  395.     Sequence:      Place events that follow into the Sequence list of the
  396.                    current Block.
  397.     String         Declare one or more string variables.
  398.     Until          Repetitive execution of the current Block until the
  399.                    condition becomes TRUE.
  400.     Use            Execute a named Block "in place".
  401.     While          Repetitive execution of the current Block while the
  402.                    condition is TRUE.
  403.  
  404. Keyed Values
  405. ------------
  406.  
  407. MMOS uses the concept of keyed lists to create self-identifying data which is
  408. often used in parameter lists (see the MMOS document for more information on
  409. keyed lists). Not surprisingly, the same concept can be used directly in the
  410. ScalaScript language. The advantages of using keyed values as ScalaScript
  411. command parameter are the same as when programming in C under MMOS:
  412.  
  413. Command parameters can be optional. The caller specifies only the parameters he
  414. is interested in and lets the command use default values for the rest.
  415.  
  416. The script becomes more readable, as each keyed value is preceded by a
  417. explanatory "key."
  418.  
  419. Using keyed values ensures script compatibility between different software
  420. versions. New optional parameters can be added with keys, without changing the
  421. command syntax.
  422.  
  423. The ScalaScript language primitives do not use keyed values, because they have
  424. very few, required parameters. Keyed values are more useful for certain EX
  425. commands. For example, consider a command to control sound. In its simplest
  426. form, it would just have one parameter; the name of the file to play.
  427. Additionally, one might add parameters to set the sound's volume, panning,
  428. pitch, fade-in time, fade-out time and so on. Using keyed values, the command
  429. could look like this:
  430.  
  431.     SOUND(":C/MIDI/TOCCATA.MID");
  432.  
  433. or, like this:
  434.  
  435.     SOUND(":C/MIDI/TOCCATA.MID",Volume(24),Pan(-5),FadeOut(10));
  436.  
  437. In these examples, the first parameter - the file name - is fixed. Following is
  438. a keyed list of parameters, which may be empty or contain any number of keyed
  439. values. Now, if a future version of the Sound EX adds a new option to control,
  440. say, a real-time digital reverb effect, it would just add a new key:
  441.  
  442.     SOUND(":C/MIDI/TOCCATA.MID",Reverb(10));
  443.  
  444. The new EX would play old scripts without special handling. The old Sound EX
  445. would even be able to play a script created with the new EX. If the Sound EX was
  446. programmed to ignore unknown keys, it would just skip the Reverb() key and
  447. happily play the file without reverb.
  448.  
  449. It is possible to have more than one value per key, for example:
  450.  
  451.     BRUSH(120,400,":C/GRAPHICS/LOGO.BMP",Resize(48,54));
  452.  
  453. It is even possible to have keys that contain other keys:
  454.  
  455.     BRUSH(120,400,"LOGO.BMP",bevel(on,size(4)));
  456.  
  457. The ScriptParser class offers methods that ease the parsing of keyed lists.
  458.  
  459. Event Names
  460. -----------
  461.  
  462. There are occasions when references to specific events are needed. For example:
  463.  
  464.     Branch events (GOTO, EXIT, JUMP, USE)
  465.     Expressions with variables.
  466.     Named styles.
  467.  
  468. It has already been shown how to name an event with the ":name" construct:
  469.  
  470.     :foo event                // a Block with the name "foo"
  471.     Group:
  472.         integer(my_var);      // a variable object with the name "my_var"
  473.     Sequence:
  474.         :bar text("hello");   // an event with the name "bar"
  475.     end
  476.  
  477. All atoms may have names, some of them require names. For instance, variable are
  478. not useful unless they are named.
  479.  
  480. Note that certain commands accept an event name through a notation different
  481. than the ":name" construct described above. Variables, for instance, take their
  482. name as a parameter to the declaration of the variable. This is usually only
  483. done when the name is required, as it is for a variable.
  484.  
  485. Name Collisions
  486. ---------------
  487.  
  488. It is possible for event names to collide under certain circumstances as they
  489. are used for more than one purpose in scripting. Event names are currently used
  490. for three reasons:
  491.  
  492. Labels         - Used as targets for branching.
  493. Variable Names - Allow variables to be referenced as parameters or in expressions.
  494. Style Names    - Allow defined styles to be created for text and other elements.
  495.  
  496. When writing or authoring scripts, one must bear in mind that all of these names
  497. use the same name space. Specifically, the use of a name in one area (as a
  498. variable name, for instance), may interfere with the use of that same name in
  499. another area (as a label, for instance). The best policy is to keep all names
  500. within a script unique.
  501.  
  502. Attaching Names to Events
  503. -------------------------
  504.  
  505. When the script exists in memory as an object hierarchy, labels are maintained
  506. as part of the event that they name. The question is, how are these names
  507. represented in the ScalaScript language? There are three cases to consider here:
  508. Labels, variables and styles.
  509.  
  510. Labels, as previously mentioned, are described using a leading colon. In
  511. ScalaScript, the label precedes the event to be named:
  512.  
  513.     :TestLabel
  514.     EVENT        // this event (a Block) will take the name "TestLabel"
  515.     END
  516.  
  517. Names defined this way should not be used before variable definitions or style
  518. definitions.
  519.  
  520. Variables contain the label name internal to the definition. For instance, the
  521. definition:
  522.  
  523.     INTEGER(my_var);
  524.  
  525. can be thought of as creating a labeled integer variable:
  526.  
  527.     :my_var INTEGER_VARIABLE(); // for example only, can't really do this.
  528.  
  529. That is, the variable definition creates a variable instance with the given
  530. name. Having a single variable definition statement that declares multiple
  531. variables (INTEGER(x,y,z);) is equivalent to having multiple labels with
  532. multiple variable entities. This explains why variable names and labels can
  533. collide, they are really using the same internal mechanism for their
  534. implementation.
  535.  
  536. Styles, such as those implemented by the elements in the Screen book, are
  537. implemented in a similar way to variables. The label name is given internally to
  538. the definition:
  539.  
  540.     TextStyle(my_style, font("helvetica 20"), face(on, pen(7)));
  541.  
  542. defines a text style with a specific set of attributes (font and color). This is
  543. equivalent to the statement:
  544.  
  545.     // not real, for example only.
  546.     :my_style TextStyle(font("helvetica 20"), face(on, pen(7)));
  547.  
  548. except in the actual implementation, with the name given in the command, the
  549. event name is required. That is, by placing the event name inside of a command
  550. implemented by an EX, that name becomes required. This means that when a style
  551. is defined it must have a name.
  552.  
  553. Scope
  554. -----
  555.  
  556. The scope of an event - whether it is a Block, a variable or an atom -
  557. determines the part of the script where the event name is visible. A reference
  558. to an event may only be made within its scope. Scope of a name is determined by
  559. the following rule:
  560.  
  561. Part 1: An event name's scope consists of all events within the Block in which
  562. the name is defined, including sub-events that are nested within that Block.
  563.  
  564. Part 2: If a reference is made to an event name that has multiple definitions
  565. that all meet Part 1 of this rule, the name whose parent Block is "closest" to
  566. the reference will be used. Here "closest" means "shortest path".
  567.  
  568. A few examples to clarify this rule:
  569.  
  570.     :Chapter1 EVENT
  571.       Sequence:
  572.         :Page1.1 EVENT
  573.             :
  574.         END
  575.             :
  576.     END
  577.  
  578.     :Chapter2 EVENT
  579.       Sequence:
  580.         :Page2.1 EVENT
  581.             :
  582.         END
  583.  
  584.         EVENT(Page2.5)
  585.             GOTO(Page2.1);     // Goto number 1
  586.             GOTO(Chapter2);    // Goto number 2
  587.             GOTO(Chapter1);    // Goto number 3
  588.             GOTO(Page1.1);     // Goto number 4
  589.         END
  590.     END
  591.  
  592. The four alternative GOTOs labeled 1-4 are branch events with references to
  593. other events:
  594.  
  595. The GOTO(Page2.1) branch is within the scope of Page2.1 as Page2.1 is defined
  596. within the Block that contains the GOTO event.
  597.  
  598. The GOTO(Chapter2) branch is within the scope of Chapter2 as Chapter2 is defined
  599. within the root Block, which contains all events in the script.
  600.  
  601. The GOTO(Chapter1) branch is within the scope of Chapter1 for the same reason as 2.
  602.  
  603. The GOTO(Page1.1) branch is not within the scope of Page1.1 and is therefore
  604. illegal. This is because Page1.1's parent is Chapter1, which is not an ancestor
  605. of the GOTO event.
  606.  
  607. Now an example that demonstrates the rule's second part:
  608.  
  609.     :Chapter1 EVENT
  610.       Sequence:
  611.         :TitlePage EVENT       // Note {1}.
  612.             :
  613.         END
  614.             :
  615.     END
  616.  
  617.     :Chapter2 EVENT
  618.       Sequence:
  619.         :TitlePage EVENT       // Note {2}.
  620.             :
  621.         END
  622.         :Section2.1 EVENT
  623.           Sequence:
  624.             :TitlePage EVENT   // Note {3}.
  625.                 :
  626.             END
  627.                 :
  628.             GOTO(TitlePage);
  629.         END
  630.     END
  631.  
  632. Here, there are three events named TitlePage. The first part of the scope rule
  633. eliminates {1} as it is not contained within the Block in which the name is
  634. defined. The second two are both pass part one of the rule, so the Player must
  635. choose between them. It uses the second part of the rule to resolve any
  636. conflicts. The path from the GOTO to {3}'s parent is shorter than the path to
  637. {2}'s parent, therefore, the GOTO is within {3}'s scope.
  638.  
  639. Binding
  640. -------
  641.  
  642. There are two possible methods of finding an event name in a script given a
  643. reference to that name:
  644.  
  645. Static binding - or reference by connector - means that the binding is done when
  646. the script is loaded. The reference is established by a Connector such that
  647. there is no need to search for a named event during playback. The connection
  648. does not change during the entire playback of the script.
  649.  
  650. Dynamic binding - or reference by name - means that the binding is done during
  651. playback of the script. Every time the event is needed, the player must search
  652. the script for an event with the given name. There are actually other types of
  653. dynamic binding, an event can be referenced by relative position in the Sequence
  654. (JUMP) or by exiting a certain number of Blocks (EXIT).
  655.  
  656. Static binding is fast compared with dynamic binding. There is no searching for
  657. the target event or computing the location of the name at run time. However, the
  658. referenced event will always remain the same regardless of the execution of the
  659. script.
  660.  
  661. Dynamic binding is more flexible, but is slower and often not necessary. Dynamic
  662. binding only matters where a single name reference may be accessed from more
  663. than one place in the script. For instance, suppose a string is created that
  664. references a variable:
  665.  
  666.     event
  667.     Group:
  668.         Integer(x);   x   = 3;
  669.         String(str);  str = "x is !x";
  670.     ...
  671.  
  672. And then, within that script there are two different uses of that string:
  673.  
  674.     ...
  675.         EVENT
  676.         Group:
  677.             integer(x);
  678.         Sequence:
  679.             x=100;
  680.             TEXT(10,20,str);
  681.         end
  682.     ...
  683.         EVENT
  684.         Group:
  685.             integer(x);
  686.         Sequence:
  687.             x=9123;
  688.             TEXT(10,20,str);
  689.         end
  690.     ...
  691.  
  692. If the string uses static binding internally, then it will bind the value of x
  693. to 3 when the script is parsed. When the script is run, it will print "x is 3"
  694. twice. If the string uses dynamic binding internally, then each use of the
  695. string (once in each of the TEXT commands) will bind when they are run. This
  696. means that the script will print "x is 100" and "x is 9123".
  697.  
  698. In ScalaScript, the GOTO and USE commands use static binding, as do variables
  699. used in expressions. The JUMP and EXIT commands use dynamic binding, as does
  700. variable substitution in strings ("!-expressions").
  701.  
  702. Note that where a resource is called from does not change the binding of names
  703. in that resource. This is best shown through examples:
  704.  
  705.     event
  706.     Group:
  707.         integer(x);
  708.         x = 100;
  709.     Sequence:
  710.         use(foo);
  711.         event
  712.         Group:
  713.             integer(x);
  714.             x=123;
  715.         Sequence:
  716.             use(foo);
  717.         end
  718.     Resources:
  719.         :foo text("x is !x");
  720.     end
  721.  
  722. This script will print "x is 100" twice. The resolution of the name "x" does not
  723. happen from where the resource is used, it happens from where the resource is
  724. defined in the script. Therefore, the name "x" referenced in the Resources list
  725. will be found at the outer level regardless of whether static or dynamic binding
  726. is used.
  727.  
  728. Or, look at this script:
  729.  
  730.     event
  731.     Sequence:
  732.         event
  733.         Sequence:
  734.             use(foo);
  735.         Resources:
  736.             :bar text("inner level");
  737.         end
  738.     Resources:
  739.         :foo goto(bar);
  740.         :bar text("outter level");
  741.     end
  742.  
  743. This script will print "inner level". Again, this is because the GOTO is
  744. resolved from its actual location in the script and not where it is used. This
  745. has nothing to do with static vs. dynamic binding, but is determined solely by
  746. the way resources are handled.
  747.  
  748. Constructing Scripts
  749. --------------------
  750.  
  751. A script consists of a series of "events" or statements. A statement might look
  752. like the following:
  753.  
  754.     Display(style(display1));
  755.     Text ( 10, 10, "Hello, world!" );
  756.     While(x = 1);
  757.     OFFSET( -32, 0 );
  758.     Integer(temptime,timeofday,timeoffset[20]);
  759.     temptime = timeofday + timeoffset[12];
  760.     else();
  761.  
  762. Where the semicolon terminates each statement.
  763.  
  764. Parameters to commands are enclosed in parenthesis and multiple parameters are
  765. separated by commas. Parameters may include named options such as this TEXT
  766. command which has a Style() and an Outline() option:
  767.  
  768.     Text(0, 0, "Outline", Style(t2), Outline(on, Thickness(2), Fill(Pen(1))));
  769.  
  770. Note that options may be embedded within options as in Outline(). This may go
  771. arbitrarily deep. For instance, the Text() command shown has an Outline() option
  772. which has a Fill() option which has a Pen() option.
  773.  
  774. In addition to commands, scripts may use variables, array variables and
  775. functions. Most variables and arrays must be declared, although there are
  776. built-in variables (often added by EX modules) that are available without
  777. declaration. Variables and functions are often used in expressions:
  778.  
  779.     foo = temp[100] + random(1,10);
  780.  
  781. Variables that are created within the script must be declared before use:
  782.  
  783.     Integer(temp[200]);
  784.  
  785. Expressions may be used in place of command/function arguments, and that they
  786. also may be used in strings:
  787.  
  788.     // substitute the variables x and y in the string, plus use an expression.
  789.     string_var = "X value is !x, Y value is !y, product is !(x * y)";
  790.     Text(x+3,y-100,string_var);
  791.  
  792. The substitution of variables in strings is automatic, but the handling of
  793. expressions in EX command arguments must be explicitly handled by the EX.
  794.  
  795. Any command may be labeled, which binds a name with an event. A label consists
  796. of an identifier preceded by a colon. The event following the label takes the
  797. name of the label:
  798.  
  799.     :one echo("hello^n");
  800.     :two
  801.     a = a + 1;
  802.  
  803. White space does not matter. In the first statement the echo() is given the name
  804. "one" and in the second statement the assignment is given the name "two".
  805.  
  806. Labels are primarily used for execution control, that is, the script may GOTO an
  807. event with a name rather than calculating the offset of the target event. This
  808. makes the target event position independent.
  809.  
  810. A number of events may be grouped into blocks using the EVENT...END construct. A
  811. block of statements may be used anywhere a normal statement is allowed.
  812.  
  813.     event
  814.         echo("hello^n");
  815.         Text(5,235,"Practice makes perfect.");
  816.     end
  817.     :page1 event
  818.         /* stuff */
  819.     end
  820.  
  821. Note that for the 'page1' label, the label applies to the block, not to one of
  822. the events in the block.
  823.  
  824. Blocks
  825. --------
  826.  
  827. Blocks of statements created with the EVENT...END construct are known as
  828. Blocks. A script consists of a single Block contained in a file. Thus, a
  829. script might be:
  830.  
  831.     Event
  832.         /* commands and stuff here. */
  833.     End
  834.  
  835. Note that on the PC, all scripts must begin with the text "!ScalaScript", so the
  836. minimal script would be:
  837.  
  838.     !ScalaScript
  839.     // This is the minimal ScalaScript script.  Note that nothing is allowed
  840.     // to appear before the !ScalaScript introducer (no comments, blank lines,
  841.     // etc.  This script doesn't do anything.
  842.     EVENT
  843.     END
  844.  
  845. Blocks are divided into three sections: The Group list, the Sequence list and
  846. the Resources list. By default, commands go into the Sequence. To place commands
  847. into other sections, that section must be explicitly named. The sections are
  848. named as follows:
  849.  
  850.     :my_Block EVENT
  851.     Group:
  852.         /* Group stuff here */
  853.     Sequence:
  854.         /* Sequence stuff here */
  855.     Resources:
  856.         /* Resources stuff here */
  857.     END
  858.  
  859. The sections may appear in any order, but are executed in a very well-defined
  860. sequence. The Group is executed first, and all events in the Group are executed
  861. in parallel.
  862.  
  863. The Group also gives scope to events. Specifically, events in the Group remain
  864. active until the Block is exited. This means that items created in the Group
  865. are guaranteed to exist throughout the execution of the Block's Sequence list.
  866. For instance, variables declared in the Group list of a Block are available
  867. anywhere within that Block.
  868.  
  869. Generally, Blocks are not placed within the Group list of another Block. If
  870. a Block is placed into the Group of another Block, then only the Group of
  871. the inner Block will be played (the Sequence and Resources lists are ignored).
  872. The Sequence of a Block is executed after the Group, although commands in the
  873. Group have a chance to clean up after the Sequence has finished. Events in the
  874. Sequence are executed sequentially.
  875.  
  876. The Resources list is just like the Sequence list, but its events are never
  877. executed unless explicitly called.
  878.  
  879. Execution Control
  880. -----------------
  881.  
  882. Execution of a Block may be controlled through the IF, ELSEIF, ELSE, WHILE and
  883. UNTIL statements. These statements are put into the Group list of the Block
  884. and they control the execution of the entire Block. For instance, the IF
  885. statement allows a Block to execute only if the condition is true:
  886.  
  887.     EVENT
  888.     Group:
  889.         if (condition);
  890.     Sequence:
  891.         /* stuff to execute if condition is true */
  892.     END
  893.  
  894. Blocks that use if/elseif/else must be contiguous, although white space and
  895. comments between the Blocks does not matter. For instance:
  896.  
  897.     event
  898.     Group:     if (condition);
  899.     Sequence:  // execute if condition is true.
  900.     end
  901.     event
  902.     Group:     elseif (condition);
  903.     Sequence:  // execute if 'if' was false, but elseif is true.
  904.     end
  905.     event
  906.     Group:     else ();
  907.     Sequence:  // execute if 'if' and 'elseif' are false.
  908.     end
  909.  
  910. The WHILE statement repeats the execution of the Block while the condition is
  911. true.
  912.  
  913.     EVENT
  914.     Group:
  915.         while (condition);
  916.     Sequence:
  917.         /* stuff to execute while condition is true */
  918.     END
  919.  
  920. The UNTIL statement repeats the execution of the Block until the condition is
  921. true.
  922.  
  923.     EVENT
  924.     Group:
  925.         until (condition);
  926.     Sequence:
  927.         /* stuff to execute until condition is true */
  928.     END
  929.  
  930. Execution order in a script may be controlled using the GOTO, USE, JUMP, EXIT,
  931. QUIT, RETURN, SCRIPT and CHAIN commands.
  932.  
  933. GOTO is used to transfer control to a named event.
  934.  
  935.     goto(name);
  936.     ...
  937.     :name echo("this is a test^n");
  938.     /* execution continues here */
  939.  
  940. The GOTO command by default does not push a return address for the RETURN
  941. command. However, a return address may be set by using the Bookmark(TRUE)
  942. option. This allows for scripts like this:
  943.  
  944.     GOTO(foo, Bookmark(TRUE));
  945.     ...
  946.     :foo
  947.     // do stuff here.
  948.     return;
  949.  
  950. The USE command executes the named event, then returns when the event completes.
  951. Note that the named event may be a Block, in which case the entire Block
  952. will be executed. Often, the "USEd" event is kept in the Resources list, but
  953. this is not required (it may be in the Sequence list).
  954.  
  955.     use(name)
  956.     /* execution continues here */
  957.     ...
  958.     :name echo("this is a test^n");
  959.  
  960.     Sequence:
  961.         use(res)
  962.         /* execution continues here */
  963.         ...
  964.     Resources:
  965.         :res event
  966.             /* do everything in this event, then return */
  967.             echo("this is a test^n");
  968.         end
  969.  
  970. The EXIT command may be used to return from a "USEd" resource before the
  971. end of that resource:
  972.  
  973.         use(res)
  974.         ...
  975.     Resources:
  976.         :res event
  977.             /* return from the resource before the end. */
  978.             exit(1);
  979.             ...
  980.             echo("this is a test^n");
  981.         end
  982.  
  983. JUMP is used to jump a number of events forward or back.
  984.  
  985.     jump(2);
  986.     jump(-5);
  987.  
  988. EXIT is used to exit from the current block. This may cause the currently
  989. executing script to exit, which would return control to the calling script.
  990. If the current script is the top-level script, then the player terminates.
  991. Note that the EXIT command takes a parameter that indicates the number of
  992. blocks to exit:
  993.  
  994.     exit(1);
  995.     exit(5);
  996.  
  997. RETURN is used to return to a previous GOTO that has pushed a return address.
  998.  
  999.     return();
  1000.  
  1001. ONNOTIFICATION is used to set-up notification on a specific variable. When
  1002. the variable changes value, a specified action is taken. The notification
  1003. remains in effect until the variable or the ONNOTIFICATION command go out
  1004. of scope.
  1005.  
  1006.     OnNotification(variable, goto(foo));
  1007.     OnNotification(my_var, use(foo));
  1008.  
  1009. SCRIPT is used to load another file and then return when it is done.
  1010.  
  1011.     Script(":scala/scripts/test.scr");
  1012.     /* execution continues here when test.scr is done. */
  1013.  
  1014. QUIT will exit one or more scripts and return to the caller. If a script calls
  1015. another script with the SCRIPT command, and that script calls a third, then the
  1016. third script may return to the first by executing the command QUIT(2);
  1017.  
  1018.     quit(1);
  1019.     quit(5);
  1020.  
  1021. CHAIN is used to load another file and never return.
  1022.  
  1023.     Chain(":scala/scripts/test.scr");
  1024.     /* execution never returns from test.scr. */
  1025.  
  1026. The EX statement is used to load EX modules. This makes commands available to
  1027. the executing script. This statement is often used in the Environment to load EX
  1028. modules for the script.
  1029.  
  1030.     EVENT
  1031.     Group:
  1032.         EX ("button.ex");
  1033.         EX ("example.ex");
  1034.         EX ("console.ex");
  1035.         EX ("debug.ex");
  1036.         EX ("screen.ex");
  1037.         EX ("timing.ex");
  1038.         EX ("touch.ex");
  1039.     END
  1040.  
  1041. Variables
  1042. ---------
  1043.  
  1044. Variables of three types may be declared: BOOLEAN, INTEGER and STRING. Variables
  1045. must be declared before they are used (unless they are built-in). Variables must
  1046. be declared in the Group section of a Block. The scope of the variable is the
  1047. containing Block.
  1048.  
  1049.     EVENT
  1050.     Group:
  1051.         BOOLEAN(bool_1, bool_2, bool_3);
  1052.         INTEGER(int_1, int_2, int_3);
  1053.         STRING(str_1, str_2, str_3);
  1054.     Sequence:
  1055.         /* do stuff here */
  1056.     END
  1057.  
  1058. These three types also allow simple arrays to be declared:
  1059.  
  1060.     BOOLEAN(bool_array[10]);
  1061.     INTEGER(int_arr[10]);
  1062.     STRING(my_str[10]);
  1063.  
  1064. Boolean variables may take on any of the following values: TRUE, FALSE, ON or
  1065. OFF. Note that TRUE and ON are equivalent, as are FALSE and OFF.
  1066.  
  1067.     Group:
  1068.         BOOLEAN(bool_1);
  1069.     Sequence:
  1070.         bool_1 = TRUE;
  1071.  
  1072. Integer variables are 32-bit, signed numbers. Decimal numbers are the default.
  1073. Hex numbers are introduced with the dollar sign ($) and binary numbers are
  1074. introduced with the percent sign (%).
  1075.  
  1076.     Group:
  1077.         INTEGER(int_1);
  1078.     Sequence:
  1079.         int_1 = 1;
  1080.         int_1 = $7F;
  1081.         int_1 = %01011;
  1082.  
  1083. Strings are contained in double-quotes and can contain a number of special
  1084. control characters:
  1085.  
  1086.     Group:
  1087.         STRING(str_1);
  1088.     Sequence:
  1089.         str_1 = "Hello^tThis is a test^n";
  1090.  
  1091. Strings may also contain variables that are expanded for display. The variables
  1092. or expressions are introduced with the bang (!) operator:
  1093.  
  1094.     Text(1,1, "X is !x, Y is !y, array index 10 is !(array[10])");
  1095.  
  1096. Note that parenthesis must enclose the expression if it is anything other than a
  1097. simple variable. These are valid:
  1098.  
  1099.     !my_var
  1100.     !(my_var)
  1101.     !(a + 1)
  1102.     !(my_array[10])
  1103.     !(my_function(a,b,10))
  1104.  
  1105. Format strings allow integer variables to be printed out with formatting. This
  1106. allows for fixed width fields, leading plus or minus signs, and leading or
  1107. trailing zeros. For example:
  1108.  
  1109.     "This is a test !(my_var, ^"###.##^") of a format string"
  1110.  
  1111. This will build a string representation of an integer variable based on
  1112. information in the format string.
  1113.  
  1114. The FORMAT function may also be used to format integer values:
  1115.  
  1116.     str_var = Format("###.##", int_var);
  1117.  
  1118. Format strings may be constructed as follows:
  1119.  
  1120.     "####" will print an integer, 4 digits wide:
  1121.  
  1122.         12345        (too wide, grows freely)
  1123.         1234         (fits fine)
  1124.          234         (shorter number is padded with spaces)
  1125.           34
  1126.            4
  1127.           -4         (negative numbers just pick up a minus sign)
  1128.          -34
  1129.  
  1130.     "0###" will print an integer with leading zeroes:
  1131.  
  1132.         1234         (fits fine)
  1133.         0234         (padded with zeroes)
  1134.         0034
  1135.  
  1136.     "#0##" will fill with leading zeros all but the first digit:
  1137.  
  1138.         1234         (fits fine)
  1139.          234         (leftmost place isn't supposed to be zero-filled)
  1140.          034         (now we get zeroes)
  1141.  
  1142.     "##.##" will print an integer as a fixed-point number based on the fractional
  1143.     digits given:
  1144.  
  1145.         12.34        (integer 1234 prints like this)
  1146.          2.34        (leading zeroes trick would work here if you wanted)
  1147.          2.3         (trailing zeroes dropped, but see below!)
  1148.           .3         (not even one leading zero)
  1149.          0           (special case)
  1150.  
  1151.     "#0.#0" is like the above example, but will always display two full decimal
  1152.     places listed plus the integral zero:
  1153.  
  1154.         12.34
  1155.          2.34
  1156.          2.30        (note the 0 in the hundredth's place)
  1157.          0.30        (never lose that upper zero)
  1158.          0.00        (as zero as we get)
  1159.  
  1160.     "-####" will print a leading minus sign:
  1161.  
  1162.          1234        (no sign printed if positive)
  1163.         -1234
  1164.         -  34        (compare to first example, where minus sign touches the 3)
  1165.  
  1166.     "+####" will print a leading plus:
  1167.  
  1168.         +1234        (even the plus is printed)
  1169.         + 234
  1170.         -1234
  1171.  
  1172.     "####<" will print a left-align number in the field:
  1173.  
  1174.         1234
  1175.         234
  1176.         34
  1177.         4
  1178.  
  1179. Notification
  1180. ------------
  1181.  
  1182. The built-in variable types (and many of the EX variables) support the
  1183. concept of "notification". This is a procedure where a variable can tell
  1184. another object that its value has changed. The object may then update its
  1185. display or internal state based on the new value of the variable.
  1186.  
  1187. For instance, the TEXT command supports notification on variables that
  1188. are referenced within strings using bang-formatting. This means that a
  1189. string may displayed with variable references that will update as the
  1190. values in the variables change. For instance:
  1191.  
  1192.     EVENT
  1193.     group:
  1194.         integer(x);
  1195.     sequence:
  1196.         x = 0;
  1197.         TEXT(10,10,"x is !x");
  1198.         EVENT
  1199.         group:
  1200.             while (x < 100);
  1201.         sequence:
  1202.             pause(1);
  1203.             x = x + 1;
  1204.         END
  1205.     END
  1206.  
  1207. Note here that the variable 'x' follows the group scope, while the text object
  1208. does not! Text objects are a part of the Element class of the Screen book and
  1209. these object follow a different set of scope rules. The Text object will
  1210. remain active until the next Display() command. Note that this script assumes
  1211. that a Display() command has already been executed. See the Element
  1212. documentation for more information.
  1213.  
  1214. So, what does this script do? It displays "x is 0". Then after one second the
  1215. value of X on screen changes to "1", then to "2", and so on. This is because
  1216. the variable is notifying the text object that its value has changed. The
  1217. text object then updates its display to show the new value.
  1218.  
  1219. Other types of objects can implement notification in their own way, it doesn't
  1220. have to involve the updating of the screen. For instance, a Television tuner
  1221. might change the channel when the value of the "channel" variable changes.
  1222.  
  1223. If an action needs to be taken when the value of a variable changes, but either
  1224. the object does not support notification or no object is available, then a
  1225. special command is available that allows actions to be taken on any variable's
  1226. notification. This command is OnNotification. It works as follows:
  1227.  
  1228.     EVENT
  1229.     group:
  1230.         OnNotification(my_var, use(foo));
  1231.     ...
  1232.  
  1233. When this command is in scope (it follows the group scope rules), the action
  1234. will be taken every time the variable changes. Actions include USE and GOTO
  1235. commands.
  1236.  
  1237. Expressions
  1238. -----------
  1239.  
  1240. Arithmetic expressions use parenthesis for grouping.
  1241.  
  1242.     Group:
  1243.         INTEGER(int_1, int_2);
  1244.     Sequence:
  1245.         int_1 = 1 + (3 ** 2);
  1246.         int_2 = $7F MOD int_1 * -3;
  1247.  
  1248. Strings allow for concatenation and assignment.
  1249.  
  1250.     Group:
  1251.         string(str1);
  1252.     Sequence:
  1253.         str1 = "hello" + ", " + "world!";
  1254.  
  1255. Logical expressions use parenthesis for grouping.
  1256.  
  1257.     Group:
  1258.         boolean(bool_1);
  1259.         integer(int_1);
  1260.     Sequence:
  1261.         bool_1 = (1 = 1) and not (3 > 7);
  1262.         int_1 = 7;
  1263.         EVENT
  1264.         Group:
  1265.             While (int_1 >= 0);
  1266.         Sequence:
  1267.             int_1 = int_1 - 1;
  1268.         END
  1269.  
  1270. Standard Functions and Variables
  1271. --------------------------------
  1272.  
  1273. Although functions are usually supplied by EX modules, the Scala Player itself
  1274. also provides a number of useful general-purpose functions and variables.
  1275.  
  1276. Functions
  1277. ---------
  1278.  
  1279.     integer ABS(integer N)
  1280.     string  CHAR(integer C)
  1281.     integer CODE(string S)
  1282.     boolean EVALBOOL(string S)
  1283.     integer EVALINT(string S)
  1284.     string  EVALSTRING(string S)
  1285.     boolean EXISTS(string FileName)
  1286.     string  FORMAT(string FormatStr, integer Value)
  1287.     string  GETENV(string Var)
  1288.     string  LEFT(string S, integer N)
  1289.     integer LENGTH(string S)
  1290.     integer MAX(integer N1, integer N1)
  1291.     integer MIN(integer N1, integer N2)
  1292.     integer RANDOM(integer Min, integer Max)
  1293.     boolean SEED(integer N)
  1294.     integer REVISION(string ModuleName)
  1295.     string  RIGHT(string S, integer N)
  1296.     integer SEARCH(string S, integer P, string T)
  1297.     integer SIGN(integer N)
  1298.     string  SUBSTRING(string S, integer P, integer N)
  1299.     integer VALUE(string S)
  1300.     integer VERSION(string ModuleName)
  1301.  
  1302. Variables
  1303. ---------
  1304.  
  1305.     string  CPU
  1306.     integer MEMORY
  1307.     string  PLATFORM
  1308.  
  1309. Detailed Information on Functions and Variables
  1310. -----------------------------------------------
  1311.  
  1312. Casting Functions
  1313. -----------------
  1314.  
  1315. Value
  1316.     integer VALUE(string S)
  1317.  
  1318.     Convert S to an integer. Returns 0 if S does not start with a number
  1319.     (leading white space is ignored). Recognizes decimal numbers (default),
  1320.     hexadecimal (prefixed with a '$'), and binary (prefixed with a '%').
  1321.  
  1322. String Functions
  1323. ----------------
  1324.  
  1325. Left
  1326.     string LEFT(string S, integer N)
  1327.  
  1328.     Return the N first characters of S. If Length(S) <= N, return S.
  1329.  
  1330. Right
  1331.     string RIGHT(string S, integer N)
  1332.  
  1333.     Return the N last characters of S. If Length(S) <= N, return S.
  1334.  
  1335. SubString
  1336.     string SUBSTRING(string S, integer P, integer N)
  1337.  
  1338.     Return substring of S, starting at position P, containing N characters.
  1339.     P should be in the range [1...Length(S)]. If N > 1+Length(S)-P, return
  1340.     as many characters as possible. If P > Length(S), return an empty string.
  1341.  
  1342. Length
  1343.     integer LENGTH(string S)
  1344.  
  1345.     Return the number of characters in S.
  1346.  
  1347. Search
  1348.     integer SEARCH(string S, integer P, string T)
  1349.  
  1350.     If T is a substring of S (starting at a position >= P) return the position
  1351.     of the first occurrence of T within S, else return 0.
  1352.  
  1353. Code
  1354.     integer CODE(string S)
  1355.  
  1356.     Return the ANSI Latin-1 code of the first character in the string S.
  1357.     If S is empty, return 0.
  1358.  
  1359. Char
  1360.     string CHAR(integer C)
  1361.  
  1362.     Return a one-character string consisting of the ASCII character defined by
  1363.     the code C.
  1364.  
  1365. Format
  1366.     string  FORMAT(string FormatStr, integer Value)
  1367.  
  1368.     Apply the specified format string to the given value and return the result
  1369.     as a string. For example:
  1370.  
  1371.         my_str = Format("-0####.##0", 123400);
  1372.  
  1373.     Will return the string "-00123.400".
  1374.  
  1375. Math Functions
  1376. --------------
  1377.  
  1378. Min
  1379.     integer MIN(integer N1, integer N2)
  1380.  
  1381.     If N1 > N2 return N2 else return N1.
  1382.  
  1383. Max
  1384.     integer MAX(integer N1, integer N1)
  1385.  
  1386.     If N1 > N2 return N1 else return N2.
  1387.  
  1388. Abs
  1389.     integer ABS(integer N)
  1390.  
  1391.     If N < 0 return -N else return N.
  1392.  
  1393. Sign
  1394.     integer SIGN(integer N)
  1395.  
  1396.     If N < 0 return -1 else if N > 0 return 1 else return 0.
  1397.  
  1398. Random
  1399.     integer RANDOM(integer Min, integer Max)
  1400.  
  1401.     Returns a random number in the range [Min...Max].
  1402.  
  1403. Seed
  1404.     boolean SEED(integer N)
  1405.  
  1406.     Seed the random number generator; N can be any number. The function
  1407.     returns True always.
  1408.  
  1409. Expression Evaluation
  1410. ---------------------
  1411.  
  1412. EvalString
  1413.     string EVALSTRING(string S)
  1414.  
  1415.     Evaluate the string expression contained in the string S and return the
  1416.     result.
  1417.  
  1418. EvalInt
  1419.     integer EVALINT(string S)
  1420.  
  1421.     Evaluate the integer expression contained in the string S and return the
  1422.     result.
  1423.  
  1424. EvalBool
  1425.     boolean EVALBOOL(string S)
  1426.  
  1427.     Evaluate the boolean expression contained in the string S and return the
  1428.     result.
  1429.  
  1430. System Functions
  1431. ----------------
  1432.  
  1433. GetEnv
  1434.     string GETENV(string Var)
  1435.  
  1436.     Return the contents of the OS (not Player) Environment variable Var. If
  1437.     the variable is not defined, or the OS doesn't support Environment
  1438.     variables, return empty string. May not be available on all platforms.
  1439.  
  1440. Exists
  1441.     boolean EXISTS(string FileName)
  1442.  
  1443.     Return TRUE if and only if a file named FileName exists.
  1444.  
  1445. Version and Revision
  1446.     integer VERSION(string ModuleName)
  1447.     integer REVISION(string ModuleName)
  1448.  
  1449.     Return the version/revision number of a module (e.g. "player.book" or
  1450.     "mpeg.ex").
  1451.  
  1452. System Variables
  1453. ----------------
  1454.  
  1455. Platform
  1456.     string PLATFORM
  1457.  
  1458.     Environment variable containing the name of the OS platform, such as
  1459.     "MSDOS", "GIEOS", etc.
  1460.  
  1461. CPU
  1462.     string CPU
  1463.  
  1464.     Environment variable containing the a CPU name, such as: "386", "486",
  1465.     "Pentium", etc.
  1466.  
  1467. Memory
  1468.     integer MEMORY
  1469.  
  1470.     Environment variable containing the total amount (not necessarily free)
  1471.     of RAM in bytes.
  1472.  
  1473.  
  1474.  
  1475.  
  1476. -------------------------------------------------------------------------------
  1477.  
  1478. 2.  Sound EX Script Commands and Variables
  1479. ==========================================
  1480.  
  1481. The Sound EX supports pre-seek/buffering/loading and sound spooling from disk.
  1482. This EX provides a set of commands, functions and variables for controlling and
  1483. configuring sound from in Scala Scripts.
  1484.  
  1485. The Sound EX supports playback of Audio CD's on a CD-ROM drive, Wave files
  1486. (.WAV 8/16-bit mono or stereo digital audio files, also ADPCM), IFF 8SVX files
  1487. (8-bit mono uncompressed digital audio files) and General MIDI files (.MID
  1488. files, only type 0 and 1 are supported).
  1489.  
  1490. The Sound EX supports Audio CD playback by communicating with MSCDEX through
  1491. DPMI and automatically detects if a CD-ROM drive is present. MSCDEX must be
  1492. running on a DOS or Windows system. If the system is using OS/2 or Windows 95
  1493. then MSCDEX is not required. Multiple drives and pre-seek is supported.
  1494.  
  1495. Wave/8SVX (sample) playback is supported by using functions in the DPMI book -
  1496. the DPMI book currently supports all versions of the SoundBlaster cards
  1497. (including the 16-bit versions) and all 100% compatible cards. Most MediaVision
  1498. cards are also supported (the MVSOUND driver must be installed). No external
  1499. drivers are necessary since the DPMI book communicates directly with the cards.
  1500. Sound-spooling from hard-disk is supported, so is preloading/buffering.
  1501.  
  1502. MIDI playback is done entirely by the Sound EX. This also includes the
  1503. communication with the various chips and cards. Three chips/cards are currently
  1504. supported:
  1505.  
  1506.     MPU401, AWE32 and Gravis UltraSound.
  1507.  
  1508. Since several cards use an MPU401 not only for communication with external
  1509. equipment but also for their internal audio, cards like the Roland RAP-10 and
  1510. LAPC1/MT32 will also work with the MPU401 setting. No external drivers are
  1511. necessary, except for the Gravis UltraSound support which depends on the
  1512. ULTRAMID TSR being present (NOTE: ULTRAMID must be started with the -c option).
  1513.  
  1514. Sound EX Commands
  1515.  
  1516. Below is a list of all Scala Script commands provided by the Sound EX.
  1517. Parameters within brackets are optional.
  1518.  
  1519. Overview
  1520.  
  1521. CD Commands
  1522.  
  1523.     CD.Eject([FADE(secs)] [,UNIT(unit)])
  1524.     CD.Pan(Panning [,UNIT(unit)])
  1525.     CD.Pause([FADE(secs)] [,UNIT(unit)])
  1526.     CD.Play(InTrack, OutTrack [,WAIT(bool)] [,LOOPS(loops)]
  1527.             [,PAN(panval)] [,FADE(vol,secs)] [,UNIT(unit)])
  1528.     CD.PlayMSF(InMSF, OutMSF [,WAIT(bool)] [,LOOPS(loops)]
  1529.             [,PAN(panval)] [,FADE(vol,secs)] [,UNIT(unit)])
  1530.     CD.ReadToc([UNIT(unit)])
  1531.     CD.Resume([FADE(vol,secs)] [,WAIT(bool)] [,UNIT(unit)])
  1532.     CD.Stop([FADE(secs)] [,UNIT(unit)])
  1533.     CD.Sync(SyncMSF [,TRACK(bool)] [,UNIT(unit)])
  1534.     CD.Volume(FadeTo, FadeTime [,WAIT(bool)] [,UNIT(unit)])
  1535.     CD.Wait([UNIT(unit)])
  1536.  
  1537. Midi Commands
  1538.  
  1539.     Midi.Pan(Panning)
  1540.     Midi.Pause([FADE(secs)])
  1541.     Midi.Play(FileName [,RATE(rate)] [,WAIT(bool)] [,LOOPS(loops)]
  1542.             [,PAN(panval)] [,FADE(vol,secs)])
  1543.     Midi.Resume([FADE(vol,secs)] [,WAIT(bool)])
  1544.     Midi.Stop([FADE(secs)])
  1545.     Midi.Volume(FadeTo, FadeTime [,WAIT(bool)])
  1546.     Midi.Wait()
  1547.  
  1548. Mixer Commands
  1549.  
  1550.     Mixer.Pan([MASTER(MasterPan)] [,VOICE(VoicePan)] [,FM(FMPan)]
  1551.             [,CD(CDPan)] [,LINEIN(LineInPan)])
  1552.     Mixer.Volume(FadeTime [,MASTER(MasterVol)] [,VOICE(VoiceVol)] [,FM(FMVol)]
  1553.             [,CD(CDVol)] [,LINEIN(LineInVol)] [,MICIN(MicInVol)])
  1554.  
  1555. Sample Commands
  1556.  
  1557.     Sample.Pan(Panning)
  1558.     Sample.Play(FileName [,RATE(rate)] [,SIGNED(bool)] [,WAIT(bool)]
  1559.             [,LOOPS(loops)] [,PAN(panval)] [,FADE(vol,secs)])
  1560.     Sample.Stop([FADE(secs)])
  1561.     Sample.Volume(FadeTo, FadeTime [,WAIT(bool)])
  1562.     Sample.Wait()
  1563.  
  1564. Details
  1565.  
  1566. CD.PLAY
  1567.     InTrack             integer  Play from track number 'InTrack'
  1568.     OutTrack            integer  Play until track number 'OutTrack'
  1569.     [WAIT(bool)]        boolean  Wait for playback to complete before
  1570.                                  continuing?
  1571.     [LOOPS(loops)]      integer  Play the sequence/track 'loops' number of
  1572.                                  times
  1573.     [PAN(panval)]       integer  Set panning value to 'panval'
  1574.                                  (range -255 to 255)
  1575.     [FADE(vol,secs)]    integer  Fade from zero to 'vol' volume
  1576.                         integer  Fade in 'secs' seconds
  1577.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1578.  
  1579.  
  1580. CD.PLAYMSF
  1581.     InMSF               string   Play from 'InMSF'
  1582.                                  format "MM:SS.FF" (mins/secs/frames)
  1583.     OutMSF              string   Play until 'OutMSF'
  1584.                                  format "MM:SS.FF" (mins/secs/frames)
  1585.     [WAIT(bool)]        boolean  Wait for playback to complete before
  1586.                                  continuing?
  1587.     [LOOPS(loops)]      integer  Play the sequence/track 'loops'
  1588.                                  number of times
  1589.     [PAN(panval)]       integer  Set panning value to 'panval'
  1590.                                  (range -255 to 255)
  1591.     [FADE(vol,secs)]    integer  Fade from zero to 'vol' volume
  1592.                         integer  Fade in 'secs' seconds
  1593.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1594.  
  1595.  
  1596. CD.SYNC
  1597.     SyncMSF             string   Halt script until 'SyncMSF' is reached
  1598.                                  format "MM:SS.FF"
  1599.     [TRACK(bool)]       boolean  Set to 'TRUE' if relative to start of track
  1600.                                  rather than start of disk.
  1601.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1602.  
  1603.  
  1604. CD.WAIT - Wait for playback to complete before continuing.
  1605.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1606.  
  1607.  
  1608. CD.STOP - Stop playback (playback can not be resumed)
  1609.     [FADE(secs)]        integer  Fade down to zero during 'secs' secs
  1610.                                  before stopping
  1611.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1612.  
  1613.  
  1614. CD.PAUSE - Pause playback (playback can be resumed if playing)
  1615.     [FADE(secs)]        integer  Fade down to zero during 'secs' secs
  1616.                                  before stopping
  1617.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1618.  
  1619.  
  1620. CD.RESUME - Resume playback (if stopped during playback)
  1621.     [FADE(vol,secs)]    integer  Fade upto 'vol' volume
  1622.                         integer  Fade in 'secs' seconds
  1623.     [WAIT(bool)]        boolean  Wait for fade to complete before continuing?
  1624.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1625.  
  1626.  
  1627. CD.EJECT - Eject the CD (not supported by all drives)
  1628.     [FADE(secs)]        integer  Fade down to zero during 'secs' secs
  1629.                                  before ejecting
  1630.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1631.  
  1632.  
  1633. CD.READTOC - Rereads the table of contents if the user has inserted a CD
  1634.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1635.  
  1636.  
  1637. CD.VOLUME
  1638.     FadeTo              integer  Set the new volume to 'FadeTo'
  1639.                                  (range 0 to 255)
  1640.     FadeTime            integer  The fade should take 'FadeTime' secs
  1641.                                  (0 if no fade)
  1642.     [WAIT(bool)]        boolean  Wait for fade to complete before continuing?
  1643.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1644. SEE ALSO: CD.HWVOL
  1645.  
  1646.  
  1647. CD.PAN
  1648.     Panning             integer  Set the new panning to 'Panning'
  1649.                                  (range -255 to 255)
  1650.     [UNIT(unit)]        integer  Command is related to CD-ROM unit 'unit'
  1651. SEE ALSO: CD.HWVOL
  1652.  
  1653.  
  1654. SAMPLE.PLAY
  1655.     FileName            string   Play the sample indicated by 'FileName'
  1656.     [RATE(rate)]        integer  Override the default rate, set to 'Rate' Hz
  1657.     [SIGNED(bool)]      boolean  Override the default sign
  1658.                                  (file contains signed data?)
  1659.     [WAIT(bool)]        boolean  Wait for playback to complete
  1660.                                  before continuing?
  1661.     [LOOPS(loops)]      integer  Play the sample 'loops' number of times
  1662.     [PAN(panval)]       integer  Set panning value to 'panval'
  1663.                                  (range -255 to 255)
  1664.     [FADE(vol,secs)]    integer  Fade from zero to 'vol' volume
  1665.                         integer  Fade in 'secs' seconds
  1666.  
  1667.  
  1668. SAMPLE.WAIT - Wait for playback to complete before continuing
  1669.  
  1670.  
  1671. SAMPLE.STOP - Stop playback (playback can be resumed if playing)
  1672.     [FADE(secs)]        integer  Fade down to zero during 'secs'
  1673.                                  seconds before stopping
  1674.  
  1675.  
  1676. SAMPLE.VOLUME
  1677.     FadeTo              integer  Set the new volume to 'FadeTo'
  1678.                                  (range 0 to 255)
  1679.     FadeTime            integer  The fade should take 'FadeTime' secs
  1680.                                  (0 if no fade)
  1681.     [WAIT(bool)]        boolean  Wait for fade to complete before continuing?
  1682.  
  1683.  
  1684. SAMPLE.PAN
  1685.     Panning             integer  Set the new panning to 'Panning'
  1686.                                  (range -255 to 255)
  1687.  
  1688.  
  1689. MIXER.VOLUME
  1690.     FadeTime            integer  The fade should take 'FadeTime' secs
  1691.                                  (0 if no fade)
  1692.     [MASTER(MasterVol)] integer  The new Master volume (range 0 to 255)
  1693.     [VOICE(VoiceVol)]   integer  The new Voice/Sample volume (range 0 to 255)
  1694.     [FM(FMVol)]         integer  The new FM/Midi volume (range 0 to 255)
  1695.     [CD(CDVol)]         integer  The new CD volume (range 0 to 255)
  1696.     [LINEIN(LineInVol)] integer  The new Line In volume (range 0 to 255)
  1697.     [MICIN(MicInVol)]   integer  The new Mic In volume (range 0 to 255)
  1698.  
  1699.  
  1700. MIXER.PAN
  1701.     [MASTER(MasterPan)] integer  The new Master panning (range -255 to 255)
  1702.     [VOICE(VoicePan)]   integer  The new Voice/Sample panning
  1703.                                  (range -255 to 255)
  1704.     [FM(FMPan)]         integer  The new FM/Midi panning (range -255 to 255)
  1705.     [CD(CDPan)]         integer  The new CD panning (range -255 to 255)
  1706.     [LINEIN(LineInPan)] integer  The new Line In panning (range -255 to 255)
  1707.  
  1708.  
  1709.  
  1710. MIDI.PLAY
  1711.     FileName            string   Play the Midi file indicated by 'FileName'
  1712.     [RATE(rate)]        integer  Override the default rate, set to 'Rate' bpm
  1713.     [WAIT(bool)]        boolean  Wait for playback to complete before
  1714.                                  continuing?
  1715.     [LOOPS(loops)]      integer  Play the Midi file 'loops' number of times
  1716.     [PAN(panval)]       integer  Set panning value to 'panval'
  1717.                                  (range -255 to 255)
  1718.     [FADE(vol,secs)]    integer  Fade from zero to 'vol' volume
  1719.                         integer  Fade in 'secs' seconds
  1720.  
  1721.  
  1722. MIDI.WAIT - Wait for playback to complete before continuing
  1723.  
  1724.  
  1725. MIDI.STOP - Stop playback (playback can not be resumed)
  1726.     [FADE(secs)]        integer  Fade down to zero during 'secs'
  1727.                                  seconds before stopping
  1728.  
  1729.  
  1730. MIDI.PAUSE - Stop playback (playback can be resumed if playing)
  1731.     [FADE(secs)]        integer  Fade down to zero during 'secs'
  1732.                                  seconds before stopping
  1733.  
  1734.  
  1735. MIDI.RESUME - Resume playback (if playback was previously stopped)
  1736.     [FADE(vol,secs)]    integer  Fade up to 'vol' volume
  1737.                         integer  Fade in 'secs' seconds
  1738.     [WAIT(bool)]        boolean  Wait for fade to complete before continuing?
  1739.  
  1740.  
  1741. MIDI.VOLUME
  1742.     FadeTo              integer  Set the new volume to 'FadeTo'
  1743.                                  (range 0 to 255)
  1744.     FadeTime            integer  The fade should take 'FadeTime' secs
  1745.                                  (0 if no fade)
  1746.     [WAIT(bool)]        boolean  Wait for fade to complete before continuing?
  1747.  
  1748.  
  1749. MIDI.PAN
  1750.     Panning             integer  Set the new panning to 'Panning'
  1751.                                  (range -255 to 255)
  1752.  
  1753.  
  1754. Sound Variables and Functions
  1755.  
  1756. FUNCTIONS:
  1757.  
  1758. Name                            Type    Description
  1759. ------------------------------------------------------------------------
  1760. CD.LengthTrack(tracknumber)     String  Length of any given tracknumber
  1761.  
  1762. VARIABLES:
  1763.  
  1764. Name            Type    Example         Description
  1765. -----------------------------------------------------------------------
  1766. CD.DiscLength   String  "54:32"         Total playing time whole disc
  1767. CD.DiscTime     String  "23:45"         Elapsed time whole disc
  1768. CD.FirstDrive   String  "D"             Drive letter of first CD drive
  1769. CD.MaxTracks    Integer 12              Number of tracks on disc
  1770. CD.NumDrives    Integer 1               Number of CD drives on this PC
  1771. CD.Track        Integer 3               Current track number
  1772. CD.TrackLength  String  "04:56"         Length this track
  1773. CD.TrackTime    String  "01:23"         Elapsed time this track
  1774.  
  1775. CD variables are Read Only. You cannot assign values to them.
  1776.  
  1777.  
  1778. Name            Type    Range           Description
  1779. -----------------------------------------------------------------------
  1780. Mixer.CDPan     Integer -255...255      CD Pan
  1781. Mixer.CDVol     Integer 0..255          CD Volume
  1782. Mixer.LinePan   Integer -255...255      Line Pan
  1783. Mixer.LineVol   Integer 0..255          Line Volume
  1784. Mixer.MasterPan Integer -255...255      Master Pan
  1785. Mixer.MasterVol Integer 0..255          Master Volume
  1786. Mixer.MicVol    Integer 0..255          Microphone Volume
  1787. Mixer.MIDIPan   Integer -255...255      MIDI Pan
  1788. Mixer.MIDIVol   Integer 0..255          MIDI Volume
  1789. Mixer.SamplePan Integer -255...255      Sample Pan
  1790. Mixer.SampleVol Integer 0..255          Sample Volume
  1791.  
  1792. Mixer variables are Read/Write. You can read their current value
  1793. or set a new value.
  1794.  
  1795. All volume settings range from 0 to 255, while all panning settings range from
  1796. -255 to 255 (-255 equals full left channel, 0 equals full left and right
  1797. channel, 255 equals full right channel.)
  1798.  
  1799. Sound Environment variables
  1800.  
  1801. Environment variables are used to configure the Sound EX. Below is a sample
  1802. configuration file for the Sound EX (sound.sca). This file should be placed
  1803. into the "config" directory of the system.
  1804.  
  1805.     !ScalaScript
  1806.     EVENT
  1807.         CD.Hwvol    = FALSE;
  1808.         Sample.Type = "NONE";
  1809.         Sample.Addr = $220;
  1810.         Sample.Irq  = 5;
  1811.         Sample.Dma  = 1;
  1812.         Midi.Type   = "NONE";
  1813.         Midi.Addr   = $330;
  1814.         Midi.Patch  = "NONE";
  1815.     END
  1816.  
  1817. Here is a brief description of the Sound EX module's Environment variables.
  1818.  
  1819. CD.HWVOL = FALSE;
  1820.  
  1821. The CD volume can be controlled in two ways: Either by using the CD-ROM hardware
  1822. for controlling the volume (not supported by all manufacturers), or by using the
  1823. soundcard's mixer functions. Set this boolean variable to TRUE if you would like
  1824. to use the CD-ROM hardware for controlling the volume.
  1825.  
  1826. SAMPLE.TYPE = "NONE";
  1827.  
  1828. This variable defines the type of soundcard installed in your machine (for
  1829. sample playback).
  1830.  
  1831.     "NONE"        No card has been installed.
  1832.     "SB1.X"       SoundBlaster version 1.x.
  1833.     "SB1.5"       SoundBlaster version 1.5.
  1834.     "SB2.0"       SoundBlaster version 2.0.
  1835.     "SBPRO"       SoundBlaster Pro series.
  1836.     "SB16"        SoundBlaster 16-bit cards.
  1837.     "AWE32"       SoundBlaster 16-bit cards.
  1838.     "MEDIAVISION" MediaVision - use MVSOUND.
  1839.  
  1840. SAMPLE.ADDR = $220;
  1841.  
  1842. This variable defines the address of the soundcard. The dollar sign prefixes a
  1843. hexa-decimal address.
  1844.  
  1845. SAMPLE.IRQ = 5;
  1846.  
  1847. This variable defines the soundcard's irq number. Most Blaster cards do not need
  1848. this setting.
  1849.  
  1850. SAMPLE.DMA = 1;
  1851.  
  1852. This variable defines the soundcard 's dma channel. Most cards do not need this
  1853. setting.
  1854.  
  1855. MIDI.TYPE = "NONE";
  1856.  
  1857. This variable defines the type of MIDI card installed in your machine (for MIDI
  1858. playback).
  1859.  
  1860.     "NONE"   No card has been installed.
  1861.     "MPU401" General Midi chip used by most cards for communication
  1862.              with external equipment - also used by the Roland RAP-10
  1863.              and Roland LAPC1/MT32 cards for internal audio.
  1864.     "AWE32"  SoundBlaster AWE32 / EMU8000.
  1865.     "GUS"    Gravis UltraSound - use ULTRAMID.EXE.
  1866.  
  1867. MIDI.ADDR = $330;
  1868.  
  1869. This variable defines the address of your MIDI card, which is normally $330 for
  1870. MPU401 and $620 for the AWE32. The dollar sign prefixes a hexadecimal address.
  1871.  
  1872. MIDI.PATCH = "NONE";
  1873.  
  1874. This variable defines the name of a patch or soundfonts (SBK) file that should
  1875. automatically be loaded upon startup .
  1876.  
  1877.  
  1878. Example scripts
  1879.  
  1880. The following "intro" script plays the first 10 seconds of each track on the CD.
  1881.  
  1882. EVENT
  1883. Group:
  1884.     INTEGER(track);
  1885. Sequence:
  1886.     EVENT
  1887.     Group:
  1888.         WHILE(track < CD.MAXTRACK)
  1889.     Sequence:
  1890.         track = track + 1;
  1891.         CD.PLAY(track, track, Wait(FALSE));
  1892.         CD.SYNC("00:10.00", Track(TRUE));
  1893.     END
  1894. END
  1895.  
  1896. The following "jukebox" script uses the Console EX for reading input and writing
  1897. messages onto the screen.
  1898.  
  1899. EVENT
  1900. Group:
  1901.     INTEGER(track);
  1902.     track = 1;
  1903. Sequence:
  1904.     EVENT
  1905.     Group:
  1906.         WHILE(track > 0)
  1907.     Sequence:
  1908.         ECHO("\nEnter track number: ");
  1909.         ASK(track);
  1910.         CD.PLAY(track, track, Wait(FALSE));
  1911.     END
  1912. END
  1913.  
  1914. The following script plays track one on the CD and crossfades to the WAV file
  1915. indicated, waiting for completion.
  1916.  
  1917. EVENT
  1918. Sequence:
  1919.     MIXER.VOLUME(Voice(0), CD(255));
  1920.     CD.PLAY(1, 1, Wait(FALSE));
  1921.     SAMPLE.PLAY(":n/archive/sounds/jazzriff.wav", Wait(FALSE));
  1922.     MIXER.FADE(10, Voice(255), CD(0));
  1923.     SAMPLE.WAIT();
  1924. END
  1925.  
  1926.  
  1927.  
  1928.  
  1929. -------------------------------------------------------------------------------
  1930.  
  1931. 3.  Input EX Script Commands
  1932. ============================
  1933.  
  1934. Input():
  1935.  
  1936.     Input(
  1937.         [ Mouse( BOOL ) ]
  1938.         [ TouchScreen( BOOL ) ]
  1939.         [ Keyboard( BOOL ) ]
  1940.         [ MouseControls( BOOL ) ]
  1941.         [ KeyboardControls( BOOL ) ]
  1942.         [ MousePointer( STRING ) ]
  1943.         [ MouseBusyPointer( STRING ) ]
  1944.         [ PointerSelectionOnly( BOOL ) ]
  1945.         )
  1946.     
  1947.     Button Input
  1948.     ------------
  1949.     
  1950.     - Mouse( BOOL )
  1951.         Use a mouse as the ButtonsEX input device.  This option is mutually
  1952.         exclusive with the TouchScreen option.
  1953.     
  1954.     - TouchScreen( BOOL )
  1955.         Use a touch screen as the ButtonsEX input device.  This option is
  1956.         mutually exclusive with the Mouse option.
  1957.     
  1958.     - Keyboard( BOOL )
  1959.         Use the keyboard as the ButtonsEX input device.  This can be used
  1960.         with Mouse or TouchScreen.
  1961.     
  1962.     
  1963.     Slideshow Controls
  1964.     ------------------
  1965.     
  1966.     - MouseControls( BOOL )
  1967.         Allows the mouse to navigate through a slideshow.  This option will
  1968.         be ignored while the Mouse() option is on AND there are buttons on
  1969.         the current page.  
  1970.     
  1971.     - KeyboardControls( BOOL )
  1972.         Allow the keyboard to navigate through a slideshow.
  1973.     
  1974.     
  1975.     Mouse Pointer
  1976.     -------------
  1977.     
  1978.     - MousePointer( STRING )
  1979.         Filename of normal mouse pointer image.  The image file can be a .bmp
  1980.         or other image file format that Scala supports for Clips.  By
  1981.         default, Scala will use Scala:\pointers\stdptr.bmp.
  1982.     
  1983.     - MouseBusyPointer( STRING )
  1984.         Filename of busy mouse pointer image.  The image file can be a .bmp
  1985.         or other image file format that Scala supports for Clips.  A busy
  1986.         pointer will appear when buttons are on the page but are not yet
  1987.         active.  If PointerSelectionOnly (see below) is On, a busy pointer
  1988.         can appear while the player is in an idle state and there are no
  1989.         wipes in progress.  By default, Scala will not show a busy pointer.
  1990.     
  1991.     - PointerSelectionOnly( BOOL )
  1992.         If this is On, a mouse pointer will only appear while there are
  1993.         buttons on the current page.  If this is Off, a pointer will
  1994.         appear on all pages.  Of course, if the user has not set the busy
  1995.         pointer image,  there will be no pointer when the player is idle.
  1996.  
  1997.  
  1998.  
  1999.  
  2000. -------------------------------------------------------------------------------
  2001.  
  2002. 4.  Time Script Functions and Variables
  2003. =======================================
  2004.  
  2005. Time
  2006.     string TIME
  2007.  
  2008.     Environment variable containing the current time in the current format
  2009.     (defined by a system setting).
  2010.  
  2011. Date
  2012.     string DATE
  2013.  
  2014.     Environment variable containing the current date in the current format
  2015.     (defined by a system setting).
  2016.  
  2017. Clock
  2018.     integer CLOCK
  2019.  
  2020.     Environment variable containing the number of seconds since some magic date.
  2021.  
  2022. SysTime
  2023.     integer SYSTIME(enum Mode)
  2024.  
  2025.     Where Mode can be:
  2026.         Mode     Returned Range
  2027.         ----     --------------
  2028.         Year     1995, 1996, ...
  2029.         Month    [1...12]
  2030.         Day      [1...31]
  2031.         Hour     [0...23]
  2032.         Minute   [0...59]
  2033.         Second   [0...59]
  2034.         Weekday  [1...7]
  2035.  
  2036.     For example:
  2037.         SysTime(Weekday) might return 5 (Thursday).
  2038.         SysTime(Year) might return 1996.
  2039.  
  2040.  
  2041.  
  2042.  
  2043. -------------------------------------------------------------------------------
  2044.  
  2045. 5.  MPEG EX Script Commands
  2046. ===========================
  2047.  
  2048. MPEG.Stop();
  2049.  
  2050. MPEG.Wait();
  2051.  
  2052. MPEG.Play(filename, <options>);
  2053.  
  2054.     MPEG.Play() required parameters:
  2055.  
  2056.         -filename
  2057.  
  2058.     MPEG.Play() optional parameters:
  2059.  
  2060.         - Pos(x,y),
  2061.     
  2062.         - Size(width,height),
  2063.     
  2064.         - Wait(boolean)
  2065.  
  2066.  
  2067.  
  2068.  
  2069. -------------------------------------------------------------------------------
  2070.  
  2071. 6.  Screen EX Script Commands and Variables
  2072. ===========================================
  2073.  
  2074. This is a description of the EX commands and variables supported by
  2075. the Screen EX and related EXes.
  2076.  
  2077. 1. EX Variables
  2078. ---------------
  2079.  
  2080. Various EX variables may be set to configure certain aspects of Screen
  2081. EX operation. These include:
  2082.  
  2083. Screen.ViewMode (string)
  2084.     If set, this tells the Screen EX to force all background elements
  2085.     to use a specific View mode, as if the View Mode suboption was
  2086.     specified in each background command. This overrides any View
  2087.     option specified in the background command.
  2088.  
  2089. Screen.ViewWidth (integer)
  2090.     If set, this tells the Screen EX to force all background elements
  2091.     to use a specific View width, as if the View Size suboption was
  2092.     specified in each background command. This overrides any View
  2093.     option specified in the background command.
  2094.  
  2095. Screen.ViewHeight (integer)
  2096.     If set, this tells the Screen EX to force all background elements
  2097.     to use a specific View height, as if the View Size suboption was
  2098.     specified in each background command. This overrides any View
  2099.     option specified in the background command.
  2100.  
  2101. 2. Element and Style Commands
  2102. -----------------------------
  2103.  
  2104. An element is an on-screen object created by a Scala Script command.
  2105. An element may be either a background or a foreground element. Each
  2106. background element replaces any background element that appeared
  2107. previously. Foreground elements appear in front of the current
  2108. background element, and may overlap each other. Each foreground
  2109. element will always obscure any overlapping elements that appeared
  2110. previously. When a background element is replaced by a new one, all
  2111. foreground elements that were shown on it are removed automatically.
  2112.  
  2113. Each Scala Script command that creates an element is known as an
  2114. element command. Each element command may have required parameters
  2115. that it expects, and/or optional parameters that it supports. This
  2116. section describes each of these element commands and the parameters
  2117. that it uses.
  2118.  
  2119. A style is a command that can be used to set up commonly used options
  2120. for reference by one or more element commands. Each element command
  2121. has an associated style command. A Scala Script author may choose to
  2122. use or not to use a style command for any given element command,
  2123. depending on the needs of the script. Style commands can be used to
  2124. reduce RAM and CPU utilization during Scala Script playback, by
  2125. specifying common options on the style commands and referencing those
  2126. styles by name on element commands.
  2127.  
  2128. Note that styles are not supported by the authoring system at this time.
  2129. They may, however, be hand authored. Scripts created with styles will
  2130. probably not be able to be loaded into the current authoring system.
  2131.  
  2132. An element command may reference a style command, and override some of
  2133. the options specified in the style command by re-specifying the same
  2134. option again in the element command. If an option is overridden this
  2135. way, all suboptions for that option are also overridden (unless
  2136. otherwise noted), whether or not they were specified on the element
  2137. command. Suboptions that are not specified for an overridden option
  2138. will use default values. All element and style commands, unless
  2139. otherwise noted, evaluate their parameters only once, when an element
  2140. is created.
  2141.  
  2142. Background Commands
  2143. -------------------
  2144.  
  2145. Display() and DisplayStyle():
  2146.  
  2147.     Display() creates a solid color or a patterned background.
  2148.     DisplayStyle() creates a style object that can be used to specify a
  2149.     common set of options used by one or more Display commands.
  2150.  
  2151.     Display(
  2152.         [ Style(stylename) ]
  2153.         [ Wipe(wipename, <wipe options>) ]
  2154.         [ Face(<fill options>) ]
  2155.         [ View(Mode(name), Size(width, height), Position(left, top),
  2156.              Colors(colors), Color(color)) ]
  2157.         [ Palette( Clear(state), <palette options> ) ]
  2158.         [ UserPalette( Clear(state), <palette options> ) ]
  2159.         [ Margin(left, right, top, bottom) ]
  2160.         [ Tabs(Implicit(width), Explicit(tab, ...)) ]
  2161.         [ Size(width, height) ]
  2162.         );
  2163.         
  2164.     DisplayStyle(stylename,
  2165.         [ Style(stylename) ]
  2166.         [ Wipe(wipename, <wipe options>) ]
  2167.         [ Face(<fill options>) ]
  2168.         [ View(Mode(name), Size(width, height), Position(left, top),
  2169.              Colors(colors), Color(color)) ]
  2170.         [ Palette( Clear(state), <palette options> ) ]
  2171.         [ UserPalette( Clear(state), <palette options> ) ]
  2172.         [ Margin(left, right, top, bottom) ]
  2173.         [ Tabs(Implicit(width), Explicit(tab, ...)) ]
  2174.         [ Size(width, height) ]
  2175.         );
  2176.         
  2177.     Examples:
  2178.         DisplayStyle(Fred, View(Mode("NTSC 704")));
  2179.         DisplayStyle(Wilma, Style(Fred), Face(RGB(0)));
  2180.         Display(Face(RGB($ffffff)));
  2181.         Display(Style(Fred), Face(Tile("scalabang.bmp")), Size(608,400));
  2182.  
  2183.     DisplayStyle() Required parameters:
  2184.         - stylename
  2185.             The name of the style being defined.
  2186.  
  2187.     Optional parameters:
  2188.         - Style(stylename)
  2189.             The name of a style style being defined is derived from.
  2190.  
  2191.         - Wipe(wipename, <wipe options>)
  2192.             A description of the wipe used for wiping in the element.
  2193.             If no wipe is specified, the "Cut" wipe is used.
  2194.  
  2195.         - Face(<fill options>)
  2196.             The appearance of the face of the element. For images,
  2197.             <fill options> defaults to nothing. For other elements,
  2198.             <fill options> defaults to RGB(0).
  2199.  
  2200.         - View(Mode(name), Size(width, height), Position(left, top),
  2201.                 Colors(colors), Color(color))
  2202.             This describes the View used for this background. Any
  2203.             combination of suboptions may be specified to uniquely
  2204.             describe the View to be used.
  2205.  
  2206.             Mode(name) identifies the mode by a name (in string form).
  2207.  
  2208.             Size(w,h) identifies the View by the maximum display size
  2209.             it supports. this is the size of the ViewPort that is created.
  2210.  
  2211.         - Palette( Clear(state), <palette options> )
  2212.             The palette used for this background. This defines
  2213.             specific colors to be mapped to specific pens at playback
  2214.             time.
  2215.  
  2216.             Clear(state) determines whether pens from the style
  2217.             (if any) are cleared before applying pens specified in
  2218.             this Palette option.
  2219.  
  2220.         - UserPalette( Clear(state), <palette options> )
  2221.             The user palette for this background. This defines
  2222.             specific colors to be mapped to user pen numbers during
  2223.             playback. These user pen numbers are used by other
  2224.             commands via the 'Pen' fill option to select colors for
  2225.             elements to be drawn in. During playback, these user pens
  2226.             may end up mapped to any playback pens, and the screen
  2227.             book will take care of converting one to the other. The
  2228.             net result is that elements may refer to a user pen
  2229.             number, and get the desired color, no matter which
  2230.             playback pen the user pen number is actually mapped to.
  2231.  
  2232.             Clear(state) determines whether user pens from the style
  2233.             (if any) are cleared before applying user pens specified
  2234.             in this UserPalette option.
  2235.  
  2236.         - Margin(left, right, top, bottom)
  2237.             This sets margins in the Background element to be used for
  2238.             positioning foreground elements on that background. The
  2239.             margin values may be 0 or greater, and all default to 0.
  2240.  
  2241.         - Tabs(Implicit(width), Explicit(tab, ...))
  2242.             A description of tab stops, relative to the background. If
  2243.             both Implicit and Explicit tabs are specified, explicit
  2244.             tabs are used first, and implicit tabs are used once the
  2245.             explicit tabs are used up.
  2246.  
  2247.             Implicit(width) set the distance between implied tab
  2248.             stops. This represents the number of pixels from each tab
  2249.             stop to the next. The width may be 1 or greater, and
  2250.             defaults to 50.
  2251.  
  2252.             Explicit(tab, ...) sets a list of one or more explicit tab
  2253.             stops. Each tab stop represents a number of pixels from
  2254.             the tab reference point, and may be 0 or greater. Any
  2255.             number of tab stops may be specified, but they must be
  2256.             listed in increasing order. There are no default Explicit
  2257.             tabs.
  2258.  
  2259.         - Size(width, height)
  2260.             This may be used to force a visual display size that is
  2261.             different than the ViewPort size. If no Display size is
  2262.             specified, the display will be the same size as the
  2263.             ViewPort (or View). If the display size is smaller than
  2264.             the ViewPort size, the display will be centered in the
  2265.             ViewPort.
  2266.  
  2267. Picture() and PictureStyle():
  2268.  
  2269.     Picture() creates a still image background.
  2270.     PictureStyle() creates a style object that can be used to specify a
  2271.     common set of options used by one or more Picture commands.
  2272.  
  2273.     Picture(filename,
  2274.         [ Style(stylename) ]
  2275.         [ Wipe(wipename, <wipe options>) ]
  2276.         [ Face(<fill options>) ]
  2277.         [ View(Mode(name), Size(width, height), Position(left, top),
  2278.             Colors(colors), Color(color)) ]
  2279.         [ Palette( Clear(state), <palette options> ) ]
  2280.         [ UserPalette( Clear(state), <palette options> ) ]
  2281.         [ Margin(left, right, top, bottom) ]
  2282.         [ Tabs(Implicit(width), Explicit(tab, ...)) ]
  2283.         [ Frame(frame) ]
  2284.         [ Operation(state, <operation options>) ]
  2285.         );
  2286.  
  2287.     PictureStyle(stylename,
  2288.         [ Style(stylename) ]
  2289.         [ Wipe(wipename, <wipe options>) ]
  2290.         [ Face(<fill options>) ]
  2291.         [ View(Mode(name), Size(width, height), Position(left, top),
  2292.             Colors(colors), Color(color)) ]
  2293.         [ Palette( Clear(state), <palette options> ) ]
  2294.         [ UserPalette( Clear(state), <palette options> ) ]
  2295.         [ Margin(left, right, top, bottom) ]
  2296.         [ Tabs(Implicit(width), Explicit(tab, ...)) ]
  2297.         [ Frame(frame) ]
  2298.         [ Operation(state, <operation options>) ]
  2299.         );
  2300.  
  2301.     Examples:
  2302.         PictureStyle(MaryAnn,
  2303.             Operation(ImagePalette(RGBPen(1, $ff00ff, $ffff00))));
  2304.         PictureStyle(Ginger, Style(MaryAnn));
  2305.         Picture("pic1.bmp");
  2306.         Picture("pic2.bmp", Style(Ginger), Operation(Resize(800, 600)));
  2307.  
  2308.     PictureStyle() required parameters:
  2309.         - stylename
  2310.             The name of the style being defined.
  2311.  
  2312.     Picture() required parameters:
  2313.         - filename
  2314.             The name of the file containing the image data.
  2315.  
  2316.     Optional parameters:
  2317.         - Style(stylename)
  2318.             The name of a style style being defined is derived from.
  2319.  
  2320.         - Wipe(wipename, <wipe options>)
  2321.             A description of the wipe used for wiping in the element.
  2322.             If no wipe is specified, the "Cut" wipe is used.
  2323.  
  2324.         - Face(<fill options>)
  2325.             The appearance of the face of the element. For images,
  2326.             <fill options> defaults to nothing. For other elements,
  2327.             <fill options> defaults to RGB(0).
  2328.  
  2329.         - View(Mode(name), Size(width, height), Position(left, top),
  2330.                 Colors(colors), Color(color))
  2331.             This describes the View used for this background. Any
  2332.             combination of suboptions may be specified to uniquely
  2333.             describe the View to be used.
  2334.  
  2335.             Mode(name) identifies the mode by a name (in string form).
  2336.  
  2337.             Size(w,h) identifies the View by the maximum display size
  2338.             it supports. this is the size of the ViewPort that is created.
  2339.  
  2340.         - Palette( Clear(state), <palette options> )
  2341.             The palette used for this background. This defines
  2342.             specific colors to be mapped to specific pens at playback
  2343.             time.
  2344.  
  2345.             Clear(state) determines whether pens from the style
  2346.             (if any) are cleared before applying pens specified in
  2347.             this Palette option.
  2348.  
  2349.         - UserPalette( Clear(state), <palette options> )
  2350.             The user palette for this background. This defines
  2351.             specific colors to be mapped to user pen numbers during
  2352.             playback. These user pen numbers are used by other
  2353.             commands via the 'Pen' fill option to select colors for
  2354.             elements to be drawn in. During playback, these user pens
  2355.             may end up mapped to any playback pens, and the screen
  2356.             book will take care of converting one to the other. The
  2357.             net result is that elements may refer to a user pen
  2358.             number, and get the desired color, no matter which
  2359.             playback pen the user pen number is actually mapped to.
  2360.  
  2361.             Clear(state) determines whether user pens from the style
  2362.             (if any) are cleared before applying user pens specified
  2363.             in this UserPalette option.
  2364.  
  2365.         - Margin(left, right, top, bottom)
  2366.             This sets margins in the Background element to be used for
  2367.             positioning foreground elements on that background. The
  2368.             margin values may be 0 or greater, and all default to 0.
  2369.  
  2370.         - Tabs(Implicit(width), Explicit(tab, ...))
  2371.             A description of tab stops, relative to the background. If
  2372.             both Implicit and Explicit tabs are specified, explicit
  2373.             tabs are used first, and implicit tabs are used once the
  2374.             explicit tabs are used up.
  2375.  
  2376.             Implicit(width) set the distance between implied tab
  2377.             stops. This represents the number of pixels from each tab
  2378.             stop to the next. The width may be 1 or greater, and
  2379.             defaults to 50.
  2380.  
  2381.             Explicit(tab, ...) sets a list of one or more explicit tab
  2382.             stops. Each tab stop represents a number of pixels from
  2383.             the tab reference point, and may be 0 or greater. Any
  2384.             number of tab stops may be specified, but they must be
  2385.             listed in increasing order. There are no default Explicit
  2386.             tabs.
  2387.  
  2388.         - Frame(frame)
  2389.             Which image is to be used from the named file, if the file
  2390.             contains multiple images.
  2391.  
  2392.         - Operation(state, <operation options>)
  2393.             Specifies the operations done before drawing this image.
  2394.             The state defaults to off.
  2395.  
  2396. Anim() and AnimStyle():
  2397.  
  2398.     Anim() creates an animation background.
  2399.     AnimStyle() creates a style object that can be used to specify a
  2400.     common set of options used by one or more Anim commands.
  2401.  
  2402.     Anim(filename,
  2403.         [ Style(stylename) ]
  2404.         [ Wipe(wipename, <wipe options>) ]
  2405.         [ Face(<fill options>) ]
  2406.         [ View(Mode(name), Size(width, height), Position(left, top),
  2407.             Colors(colors), Color(color)) ]
  2408.         [ Palette( Clear(state), <palette options> ) ]
  2409.         [ UserPalette( Clear(state), <palette options> ) ]
  2410.         [ Margin(left, right, top, bottom) ]
  2411.         [ Tabs(Implicit(width), Explicit(tab, ...)) ]
  2412.         [ Frame(frame) ]
  2413.         [ Operation(state, <operation options>) ]
  2414.         [ Speed(speed) ]
  2415.         [ Loops(loops) ]
  2416.         [ StopAtFirstFrame(state) ]
  2417.         );
  2418.         
  2419.     AnimStyle(stylename,
  2420.         [ Style(stylename) ]
  2421.         [ Wipe(wipename, <wipe options>) ]
  2422.         [ Face(<fill options>) ]
  2423.         [ View(Mode(name), Size(width, height), Position(left, top),
  2424.             Colors(colors), Color(color)) ]
  2425.         [ Palette( Clear(state), <palette options> ) ]
  2426.         [ UserPalette( Clear(state), <palette options> ) ]
  2427.         [ Margin(left, right, top, bottom) ]
  2428.         [ Tabs(Implicit(width), Explicit(tab, ...)) ]
  2429.         [ Frame(frame) ]
  2430.         [ Operation(state, <operation options>) ]
  2431.         [ Speed(speed) ]
  2432.         [ Loops(loops) ]
  2433.         [ StopAtFirstFrame(state) ]
  2434.         );
  2435.         
  2436.     Examples:
  2437.         AnimStyle(Barnum, Speed(40));
  2438.         AnimStyle(Bailey, Style(Barnum), Speed(60), Wipe("FlyLeft"));
  2439.         Anim("show.flc");
  2440.         Anim("show2.flc", Style(Barnum), Loops(5));
  2441.  
  2442.     AnimStyle() required parameters:
  2443.         - stylename
  2444.             The name of the style being defined.
  2445.  
  2446.     Anim() required parameters:
  2447.         - filename
  2448.             The name of the file containing the image data.
  2449.  
  2450.     Optional parameters:
  2451.         - Style(stylename)
  2452.             The name of a style style being defined is derived from.
  2453.  
  2454.         - Wipe(wipename, <wipe options>)
  2455.             A description of the wipe used for wiping in the element.
  2456.             If no wipe is specified, the "Cut" wipe is used.
  2457.  
  2458.         - Face(<fill options>)
  2459.             The appearance of the face of the element. For images,
  2460.             <fill options> defaults to nothing. For other elements,
  2461.             <fill options> defaults to RGB(0).
  2462.  
  2463.         - View(Mode(name), Size(width, height), Position(left, top),
  2464.                 Colors(colors), Color(color))
  2465.             This describes the View used for this background. Any
  2466.             combination of suboptions may be specified to uniquely
  2467.             describe the View to be used.
  2468.  
  2469.             Mode(name) identifies the mode by a name (in string form).
  2470.  
  2471.             Size(w,h) identifies the View by the maximum display size
  2472.             it supports. this is the size of the ViewPort that is created.
  2473.  
  2474.         - Palette( Clear(state), <palette options> )
  2475.             The palette used for this background. This defines
  2476.             specific colors to be mapped to specific pens at playback
  2477.             time.
  2478.  
  2479.             Clear(state) determines whether pens from the style
  2480.             (if any) are cleared before applying pens specified in
  2481.             this Palette option.
  2482.  
  2483.         - UserPalette( Clear(state), <palette options> )
  2484.             The user palette for this background. This defines
  2485.             specific colors to be mapped to user pen numbers during
  2486.             playback. These user pen numbers are used by other
  2487.             commands via the 'Pen' fill option to select colors for
  2488.             elements to be drawn in. During playback, these user pens
  2489.             may end up mapped to any playback pens, and the screen
  2490.             book will take care of converting one to the other. The
  2491.             net result is that elements may refer to a user pen
  2492.             number, and get the desired color, no matter which
  2493.             playback pen the user pen number is actually mapped to.
  2494.  
  2495.             Clear(state) determines whether user pens from the style
  2496.             (if any) are cleared before applying user pens specified
  2497.             in this UserPalette option.
  2498.  
  2499.         - Margin(left, right, top, bottom)
  2500.             This sets margins in the Background element to be used for
  2501.             positioning foreground elements on that background. The
  2502.             margin values may be 0 or greater, and all default to 0.
  2503.  
  2504.         - Tabs(Implicit(width), Explicit(tab, ...))
  2505.             A description of tab stops, relative to the background. If
  2506.             both Implicit and Explicit tabs are specified, explicit
  2507.             tabs are used first, and implicit tabs are used once the
  2508.             explicit tabs are used up.
  2509.  
  2510.             Implicit(width) set the distance between implied tab
  2511.             stops. This represents the number of pixels from each tab
  2512.             stop to the next. The width may be 1 or greater, and
  2513.             defaults to 50.
  2514.  
  2515.             Explicit(tab, ...) sets a list of one or more explicit tab
  2516.             stops. Each tab stop represents a number of pixels from
  2517.             the tab reference point, and may be 0 or greater. Any
  2518.             number of tab stops may be specified, but they must be
  2519.             listed in increasing order. There are no default Explicit
  2520.             tabs.
  2521.  
  2522.         - Frame(frame)
  2523.             Which image is to be used from the named file, if the file
  2524.             contains multiple images.
  2525.  
  2526.         - Operation(state, <operation options>)
  2527.             Specifies the operations done before drawing this image.
  2528.             The state defaults to off.
  2529.  
  2530.         - Speed(speed)
  2531.             The speed of the animation in frames per second.
  2532.  
  2533.         - Loops(loops)
  2534.             How may times to play the animation in a loop.
  2535.  
  2536.         - StopAtFirstFrame(state)
  2537.             Whether to stop the animation on the first frame after
  2538.             completion of the animation. If this is on, the first
  2539.             frame will be the last one shown. If this is off, the
  2540.             animation's last frame will be the last one shown. The
  2541.             state defaults to off.
  2542.  
  2543. FullVideo() and FullVideoStyle():
  2544.  
  2545.     FullVideo() creates a full-view video display, with no graphics display at
  2546.     all. FullVideoStyle() creates a style object that can be used to specify a
  2547.     common set of options used by one or more FullVideo commands.
  2548.  
  2549.     FullVideo(
  2550.         [ Style(stylename) ]
  2551.         [ Wipe(wipename, <wipe options>) ]
  2552.         );
  2553.     
  2554.     FullVideoStyle(stylename
  2555.         [ Style(stylename) ]
  2556.         [ Wipe(wipename, <wipe options>) ]
  2557.         );
  2558.  
  2559.     Examples:
  2560.         FullVideoStyle(Fred, Wipe("Cut"));
  2561.         FullVideoStyle(Fred, Wipe("Center", Speed(3)));
  2562.         FullVideo(Wipe("Center", Speed(4)));
  2563.         FullVideo(Style(Fred));
  2564.  
  2565.     FullVideoStyle() required parameters:
  2566.         - stylename
  2567.             The name of the style being defined.
  2568.  
  2569.     Optional parameters:
  2570.         - Style(stylename)
  2571.             The name of a style style being defined is derived from.
  2572.  
  2573.         - Wipe(wipename, <wipe options>)
  2574.             A description of the wipe used for wiping in the element.
  2575.             If no wipe is specified, the "Cut" wipe is used.
  2576.  
  2577. Foreground Commands
  2578. -------------------
  2579.  
  2580. Box() and BoxStyle():
  2581.  
  2582.     Box() creates a foreground object that is a rectangle drawn in a solid
  2583.     color or a pattern. BoxStyle() creates a style object that can be used to
  2584.     specify a common set of options used by one or more Box commands.
  2585.  
  2586.     BoxStyle(stylename,
  2587.         [ Style(stylename) ]
  2588.         [ Wipe(wipename, <wipe options>) ]
  2589.         [ Face(state, <fill options>) ]
  2590.         [ Shift(x, y) ]
  2591.         [ Transparent(state) ]
  2592.         [ Border(left, right, top, bottom) ]
  2593.         [ Outline(state, Thickness(pixels), <fill options>) ]
  2594.         [ Backdrop(state, <fill options>) ]
  2595.         [ Bevel(state, Thickness(pixels), Base(color),
  2596.             Left(<fill options>), Right(<fill options>),
  2597.             Top(<fill options>), Bottom(<fill options>)) ]
  2598.         [ Shadow(state, Offset(horizontal, vertical), <fill options>) ]
  2599.         [ Align(horizontal, vertical) ]
  2600.         [ Replace(state) ]
  2601.         );
  2602.     
  2603.     Box(X,Y,width,height,
  2604.         [ Style(stylename) ]
  2605.         [ Wipe(wipename, <wipe options>) ]
  2606.         [ Face(state, <fill options>) ]
  2607.         [ Shift(x, y) ]
  2608.         [ Transparent(state) ]
  2609.         [ Border(left, right, top, bottom) ]
  2610.         [ Outline(state, Thickness(pixels), <fill options>) ]
  2611.         [ Backdrop(state, <fill options>) ]
  2612.         [ Bevel(state, Thickness(pixels), Base(color),
  2613.                 Left(<fill options>), Right(<fill options>),
  2614.                 Top(<fill options>), Bottom(<fill options>)) ]
  2615.         [ Shadow(state, Offset(horizontal, vertical), <fill options>) ]
  2616.         [ Align(horizontal, vertical) ]
  2617.         [ Replace(state) ]
  2618.         );
  2619.  
  2620.     Examples:
  2621.         BoxStyle(Rowan, Wipe("Center", Speed(7)));
  2622.         BoxStyle(Martin, Style(Rowan), Outline(on, Thickness(2), Pen(3)));
  2623.         Box(x, y, width, height, Face(Pen(4)));
  2624.         Box(x, y, width, height, Style(Martin), Face(on, RGB($326496)));
  2625.  
  2626.     BoxStyle() required parameters:
  2627.         - stylename
  2628.             The name of the style being defined.
  2629.  
  2630.     Box() required parameters:
  2631.         - X
  2632.             The horizontal position of the element's face. This
  2633.             position may be modified by the effects of Offset commands
  2634.             in containing blocks, and by Foreground's Align option.
  2635.             See those options' descriptions for more details.
  2636.  
  2637.         - Y
  2638.             The vertical position of the element's face. This position
  2639.             may be modified by the effects of Offset commands in
  2640.             containing blocks, and by Foreground's Align option. See
  2641.             those options' descriptions for more details.
  2642.  
  2643.         - width
  2644.             The horizontal dimension of the rectangle.
  2645.     
  2646.         - height
  2647.             The vertical dimension of the rectangle.
  2648.  
  2649.     Optional parameters:
  2650.         - Style(stylename)
  2651.             The name of a style style being defined is derived from.
  2652.  
  2653.         - Wipe(wipename, <wipe options>)
  2654.             A description of the wipe used for wiping in the element.
  2655.             If no wipe is specified, the "Cut" wipe is used.
  2656.  
  2657.         - Face(state, <fill options>)
  2658.             The appearance of the face of the element. The state
  2659.             defaults to on. For images, <fill options> defaults to
  2660.             nothing. For other elements, <fill options> defaults to
  2661.             RGB($ffffff).
  2662.  
  2663.         - Shift(x, y)
  2664.             The amount the element's face, outline, and shadow are
  2665.             shifted from the specified element position. This is
  2666.             intended to be used for different button states to move
  2667.             the face without moving the backdrop or bevel. The offset
  2668.             values may be any numbers, and default to (0, 0).
  2669.  
  2670.         - Transparent(state)
  2671.             Whether or not pen zero is transparent. The state defaults
  2672.             to off. If this is on, any portion of the foreground
  2673.             element drawn in pen zero will not be visible, but will
  2674.             show through to the image beneath this foreground element.
  2675.  
  2676.         - Border(left, right, top, bottom)
  2677.             Extra space added to the edges of the element, measured in
  2678.             pixels. This effectively extends the element's bounding
  2679.             box without affecting the position of the element's face
  2680.             or the size of its face image. The border values may be 0
  2681.             or greater, and all default to 0.
  2682.  
  2683.         - Outline(state, Thickness(pixels), <fill options>)
  2684.             A colored outline added to the element. The state defaults
  2685.             to off. Thickness may be 1 or greater, and defaults to 1.
  2686.             <fill options> defaults to RGB(0).
  2687.  
  2688.         - Backdrop(state, <fill options>)
  2689.             The appearance of the bounding box of the element behind
  2690.             the face and other style options applied to the element.
  2691.             The state defaults to off. <fill options> defaults to
  2692.             RGB(0).
  2693.  
  2694.         - Bevel(state, Thickness(pixels), Base(color),
  2695.                 Left(<fill options>), Right(<fill options>),
  2696.                 Top(<fill options>), Bottom(<fill options>))
  2697.             A beveled edge added outside the element's bounding box.
  2698.             The state defaults to off. Thickness may be 1 or greater,
  2699.             and defaults to 2. Base is a hint to the authoring station
  2700.             to assist with choosing bevel colors, and is not used by
  2701.             the Screen EX otherwise. The Base color is specified as a
  2702.             4-byte hexadecimal number, where each byte encodes zero,
  2703.             red, green, and blue, from MSB to LSB. The bevel colors
  2704.             default to shades of grey.
  2705.  
  2706.         - Shadow(state, Offset(horizontal, vertical), <fill options>)
  2707.             A drop shadow drawn behind the element, drawn in a solid
  2708.             color. The state defaults to off. Either or both of the
  2709.             offsets can be positive or negative, and are measured in
  2710.             pixels. <fill options> defaults to RGB(0).
  2711.  
  2712.         - Align(horizontal, vertical)
  2713.             This determines whether the element is positioned based on
  2714.             its X,Y values, or by the Background's size and margins.
  2715.             These tables describe the alignment values and their
  2716.             meanings:
  2717.  
  2718.             Horizontal    Description
  2719.             ----------    -----------
  2720.             None        The left edge of the element's face is
  2721.                         positioned relative to the left edge of the
  2722.                         background. The element's X value and the
  2723.                         cumulative effect of all applicable Offset
  2724.                         commands are used for positioning the element.
  2725.  
  2726.             Left        The left edge of the element's face is
  2727.                         positioned at the Background's left margin.
  2728.                         The element's X value and all applicable
  2729.                         Offset commands are ignored.
  2730.  
  2731.             Center        The vertical centerline of the element's face
  2732.                         is positioned midway between the Background's
  2733.                         left and right margins. The element's X value
  2734.                         and all applicable Offset commands are
  2735.                         ignored.
  2736.  
  2737.             Right        The right edge of the element's face is
  2738.                         positioned at the Background's right margin.
  2739.                         The element's X value and all applicable
  2740.                         Offset commands are ignored.
  2741.  
  2742.             Vertical    Description
  2743.             --------    -----------
  2744.             None        The top edge of the element's face is
  2745.                         positioned relative to the left edge of the
  2746.                         background. The element's Y value and the
  2747.                         cumulative effect of all applicable Offset
  2748.                         commands are used for positioning the element.
  2749.  
  2750.             Top            The top edge of the element's face is
  2751.                         positioned at the Background's top margin. The
  2752.                         element's Y value and all applicable Offset
  2753.                         commands are ignored.
  2754.  
  2755.             Middle        The horizontal centerline of the element's
  2756.                         face is positioned midway between the
  2757.                         Background's top and bottom margins. The
  2758.                         element's Y value and all applicable Offset
  2759.                         commands are ignored.
  2760.  
  2761.             Bottom        The bottom edge of the element's face is
  2762.                         positioned at the Background's bottom margin.
  2763.                         The element's Y value and all applicable
  2764.                         Offset commands are ignored.
  2765.  
  2766.             If this option is not specified, the element's alignment
  2767.             defaults to (None, None).
  2768.  
  2769.         - Replace(state)
  2770.             This determines whether an element command will create a
  2771.             new element or replace an existing element previously
  2772.             created by the same command. If the state is On, the
  2773.             element command will replace the previous element created
  2774.             by the same command. If the state is Off, a new element
  2775.             will be created, and any previous elements created by the
  2776.             same command will remain on the screen. This defaults to
  2777.             Replace(On).
  2778.  
  2779. Button():
  2780.  
  2781.     Button() creates an interactive element on the display.
  2782.     Buttons do not support styles.
  2783.  
  2784.     Button(
  2785.         [ Wipe(wipename, <wipe options>) ]
  2786.         [ HotKey( [shift-][alt-][ctrl-]<keyname> ) ]
  2787.         [ BoxedHit(on|off) ]
  2788.         [ LinkPositions(on|off) ]
  2789.         [ MatchSize(on|off) ]
  2790.         [ Normal( [ Text|Clip|Box( <command params here > ), ]
  2791.                 [ Use|Goto(<branch parameters>) ] ) ]
  2792.         [ Highlight( [ MousePointer( <filename> ), ]
  2793.                 [ Text|Clip|Box( <command params here > ), ]
  2794.                 [ Use|Goto(<branch parameters>) ] ) ]
  2795.         [ Select( [ MousePointer( <filename> ), ]
  2796.                 [ Text|Clip|Box( <command params here > ), ]
  2797.                 [ Use|Goto(<branch parameters>) ] ) ]
  2798.         [ SelectDown( [ Use|Goto(<branch parameters>) ] ) ]
  2799.         );
  2800.         
  2801.     Examples:
  2802.  
  2803.         Button(HotKey("F"), MatchSize(On),
  2804.             Normal(Text(20, 20, "hello", Wrap(Off, Auto(610)))),
  2805.             Select(Goto("btn: hello", Bookmark(On))));
  2806.         Button(HotKey("F12"), MatchSize(On),
  2807.             Normal(Text(20, 20, "Test button",
  2808.                 Backdrop(On, Image("Scala:\buttons\steel\steel01.bmp")),
  2809.                 Wrap(Off, Auto(610)))),
  2810.             Highlight(Text(20, 20, "Test button",
  2811.                 Backdrop(On, Image("Scala:\buttons\steel\steel02.bmp")),
  2812.                 Wrap(Off, Auto(610)))),
  2813.             Select(Text(20, 20, "Test button",
  2814.                 Backdrop(On, Image("Scala:\buttons\steel\steel03.bmp")),
  2815.                 Shift(10, 10), Wrap(Off, Auto(610))), Goto("_TempName1")));
  2816.         Button(Wipe("Flyon", Direction(0)), HotKey("Space"), MatchSize(On),
  2817.             Normal(Text(20, 20, "foo", Wrap(Off, Auto(610)))),
  2818.             Select(Text(20, 20, "foo", Wrap(Off, Auto(610))), Return()));
  2819.  
  2820.     Optional parameters:
  2821.  
  2822.         - Wipe(wipename, <wipe options>)
  2823.             A description of the wipe used for wiping in the element.
  2824.             If no wipe is specified, the "Cut" wipe is used.
  2825.  
  2826.         - HotKey( [shift-][alt-][ctrl-]<keyname> )
  2827.             Specifies the key that triggers the button's selection. Buttons
  2828.             support all the keys below along with all of the qualifiers,
  2829.             although many of them don't really make sense to use
  2830.             (shift-1, ctrl-alt-DEL).
  2831.  
  2832.                 UP, DOWN, LEFT, RIGHT, ENTER, HELP, TAB,
  2833.                 SPACE, BACKSPACE, ESCAPE, F1-F12, A-Z,
  2834.                 !\#$%&'()*+,-./:;<=>?@[\]^_`{|}~
  2835.  
  2836.             The authoring station only allows A-Z, 0-9, F1-F12, and SPACE,
  2837.             and doesn't permit modifiers.
  2838.  
  2839.             Keys are specified in double quotes (they are string parameters).
  2840.             For example:
  2841.  
  2842.                 HotKey("SHIFT-ENTER"),
  2843.                 HotKey("ALT-F1"),
  2844.                 HotKey("&"),
  2845.                 HotKey("CTRL-R"),
  2846.  
  2847.         - BoxedHit(on|off)
  2848.             Tells the button to use the bounding box as the hit area
  2849.             for the mouse.
  2850.  
  2851.         - LinkPositions(on|off)
  2852.             Pertains only to authoring.
  2853.  
  2854.         - MatchSize(on|off)
  2855.             If on, all faces will have the same rectangular size.
  2856.  
  2857.         - Normal(
  2858.                 [ Text|Clip|Box( <command params here > ), ]
  2859.                 [ Use|Goto(<branch parameters>) ]*
  2860.                 ),
  2861.             The Text, Clip, or Box options is an embedded Element command.
  2862.             With the exception of the Wipe options, the embedded Element
  2863.             command supports all normal options. Wipe options will be ignored.
  2864.  
  2865.             The Use|Goto branches are embedded player branches and accept
  2866.             their normal parameters.
  2867.  
  2868.         - Highlight(
  2869.                 [ MousePointer( <filename> ), ]
  2870.                 [ Text|Clip|Box( <command params here > ), ]
  2871.                 [ Use|Goto(<branch parameters>) ]*
  2872.                 ),
  2873.             The Text, Clip, or Box options is an embedded Element command.
  2874.             With the exception of the Wipe options, the embedded Element
  2875.             command supports all normal options. Wipe options will be ignored.
  2876.  
  2877.             The Use|Goto branches are embedded player branches and accept
  2878.             their normal parameters.
  2879.  
  2880.         - Select(
  2881.                 [ MousePointer( <filename> ), ]
  2882.                 [ Text|Clip|Box( <command params here > ), ]
  2883.                 [ Use|Goto(<branch parameters>) ]*
  2884.                 ),
  2885.             The Text, Clip, or Box options is an embedded Element command.
  2886.             With the exception of the Wipe options, the embedded Element
  2887.             command supports all normal options. Wipe options will be ignored.
  2888.  
  2889.             The Use|Goto branches are embedded player branches and accept
  2890.             their normal parameters.
  2891.  
  2892.         - SelectDown(
  2893.                 [ Use|Goto(<branch parameters>) ]*
  2894.                 ),
  2895.             The Use|Goto branches are embedded player branches and accept
  2896.             their normal parameters.
  2897.  
  2898. Clip() and ClipStyle():
  2899.  
  2900.     Clip() creates a foreground object that is a rectangle drawn with a still
  2901.     image. ClipStyle() creates a style object that can be used to specify a
  2902.     common set of options used by one or more Clip commands.
  2903.  
  2904.     ClipStyle(stylename,
  2905.         [ Style(stylename) ]
  2906.         [ Wipe(wipename, <wipe options>) ]
  2907.         [ Face(state, <fill options>) ]
  2908.         [ Shift(x, y) ]
  2909.         [ Transparent(state) ]
  2910.         [ Border(left, right, top, bottom) ]
  2911.         [ Outline(state, Thickness(pixels), <fill options>) ]
  2912.         [ Backdrop(state, <fill options>) ]
  2913.         [ Bevel(state, Thickness(pixels), Base(color),
  2914.             Left(<fill options>), Right(<fill options>),
  2915.             Top(<fill options>), Bottom(<fill options>)) ]
  2916.         [ Shadow(state, Offset(horizontal, vertical), <fill options>) ]
  2917.         [ Align(horizontal, vertical) ]
  2918.         [ Replace(state) ]
  2919.         [ Frame(frame) ]
  2920.         [ Operation(state, <operation options>) ]
  2921.         );
  2922.     
  2923.     Clip(X,Y,filename,
  2924.         [ Style(stylename) ]
  2925.         [ Wipe(wipename, <wipe options>) ]
  2926.         [ Face(state, <fill options>) ]
  2927.         [ Shift(x, y) ]
  2928.         [ Transparent(state) ]
  2929.         [ Border(left, right, top, bottom) ]
  2930.         [ Outline(state, Thickness(pixels), <fill options>) ]
  2931.         [ Backdrop(state, <fill options>) ]
  2932.         [ Bevel(state, Thickness(pixels), Base(color),
  2933.             Left(<fill options>), Right(<fill options>),
  2934.             Top(<fill options>), Bottom(<fill options>)) ]
  2935.         [ Shadow(state, Offset(horizontal, vertical), <fill options>) ]
  2936.         [ Align(horizontal, vertical) ]
  2937.         [ Replace(state) ]
  2938.         [ Frame(frame) ]
  2939.         [ Operation(state, <operation options>) ]
  2940.         );
  2941.  
  2942.     Examples:
  2943.         ClipStyle(Ricky, Operation(Crop(10, 10, 80, 80)));
  2944.         ClipStyle(Lucy, Style(Ricky), Operation(Resize(100, 100)));
  2945.         Clip(x, y, "pic3.bmp");
  2946.         Clip(x, y, "pic3.bmp", Style(Lucy), Bevel(on));
  2947.  
  2948.     ClipStyle() required parameters:
  2949.         - stylename
  2950.             The name of the style being defined.
  2951.  
  2952.     Clip() required parameters:
  2953.         - X
  2954.             The horizontal position of the element's face. This
  2955.             position may be modified by the effects of Offset commands
  2956.             in containing blocks, and by Foreground's Align option.
  2957.             See those options' descriptions for more details.
  2958.  
  2959.         - Y
  2960.             The vertical position of the element's face. This position
  2961.             may be modified by the effects of Offset commands in
  2962.             containing blocks, and by Foreground's Align option. See
  2963.             those options' descriptions for more details.
  2964.  
  2965.         - filename
  2966.             The name of the file containing the image data.
  2967.  
  2968.     Optional parameters:
  2969.         - Style(stylename)
  2970.             The name of a style style being defined is derived from.
  2971.  
  2972.         - Wipe(wipename, <wipe options>)
  2973.             A description of the wipe used for wiping in the element.
  2974.             If no wipe is specified, the "Cut" wipe is used.
  2975.  
  2976.         - Face(state, <fill options>)
  2977.             The appearance of the face of the element. The state
  2978.             defaults to on. For images, <fill options> defaults to
  2979.             nothing. For other elements, <fill options> defaults to
  2980.             RGB($ffffff).
  2981.  
  2982.         - Shift(x, y)
  2983.             The amount the element's face, outline, and shadow are
  2984.             shifted from the specified element position. This is
  2985.             intended to be used for different button states to move
  2986.             the face without moving the backdrop or bevel. The offset
  2987.             values may be any numbers, and default to (0, 0).
  2988.  
  2989.         - Transparent(state)
  2990.             Whether or not pen zero is transparent. The state defaults
  2991.             to off. If this is on, any portion of the foreground
  2992.             element drawn in pen zero will not be visible, but will
  2993.             show through to the image beneath this foreground element.
  2994.  
  2995.         - Border(left, right, top, bottom)
  2996.             Extra space added to the edges of the element, measured in
  2997.             pixels. This effectively extends the element's bounding
  2998.             box without affecting the position of the element's face
  2999.             or the size of its face image. The border values may be 0
  3000.             or greater, and all default to 0.
  3001.  
  3002.         - Outline(state, Thickness(pixels), <fill options>)
  3003.             A colored outline added to the element. The state defaults
  3004.             to off. Thickness may be 1 or greater, and defaults to 1.
  3005.             <fill options> defaults to RGB(0).
  3006.  
  3007.         - Backdrop(state, <fill options>)
  3008.             The appearance of the bounding box of the element behind
  3009.             the face and other style options applied to the element.
  3010.             The state defaults to off. <fill options> defaults to
  3011.             RGB(0).
  3012.  
  3013.         - Bevel(state, Thickness(pixels), Base(color),
  3014.                 Left(<fill options>), Right(<fill options>),
  3015.                 Top(<fill options>), Bottom(<fill options>))
  3016.             A beveled edge added outside the element's bounding box.
  3017.             The state defaults to off. Thickness may be 1 or greater,
  3018.             and defaults to 2. Base is a hint to the authoring station
  3019.             to assist with choosing bevel colors, and is not used by
  3020.             the Screen EX otherwise. The Base color is specified as a
  3021.             4-byte hexadecimal number, where each byte encodes zero,
  3022.             red, green, and blue, from MSB to LSB. The bevel colors
  3023.             default to shades of grey.
  3024.  
  3025.         - Shadow(state, Offset(horizontal, vertical), <fill options>)
  3026.             A drop shadow drawn behind the element, drawn in a solid
  3027.             color. The state defaults to off. Either or both of the
  3028.             offsets can be positive or negative, and are measured in
  3029.             pixels. <fill options> defaults to RGB(0).
  3030.  
  3031.         - Align(horizontal, vertical)
  3032.             This determines whether the element is positioned based on
  3033.             its X,Y values, or by the Background's size and margins.
  3034.             These tables describe the alignment values and their
  3035.             meanings:
  3036.  
  3037.             Horizontal    Description
  3038.             ----------    -----------
  3039.             None        The left edge of the element's face is
  3040.                         positioned relative to the left edge of the
  3041.                         background. The element's X value and the
  3042.                         cumulative effect of all applicable Offset
  3043.                         commands are used for positioning the element.
  3044.  
  3045.             Left        The left edge of the element's face is
  3046.                         positioned at the Background's left margin.
  3047.                         The element's X value and all applicable
  3048.                         Offset commands are ignored.
  3049.  
  3050.             Center        The vertical centerline of the element's face
  3051.                         is positioned midway between the Background's
  3052.                         left and right margins. The element's X value
  3053.                         and all applicable Offset commands are
  3054.                         ignored.
  3055.  
  3056.             Right        The right edge of the element's face is
  3057.                         positioned at the Background's right margin.
  3058.                         The element's X value and all applicable
  3059.                         Offset commands are ignored.
  3060.  
  3061.             Vertical    Description
  3062.             --------    -----------
  3063.             None        The top edge of the element's face is
  3064.                         positioned relative to the left edge of the
  3065.                         background. The element's Y value and the
  3066.                         cumulative effect of all applicable Offset
  3067.                         commands are used for positioning the element.
  3068.  
  3069.             Top            The top edge of the element's face is
  3070.                         positioned at the Background's top margin. The
  3071.                         element's Y value and all applicable Offset
  3072.                         commands are ignored.
  3073.  
  3074.             Middle        The horizontal centerline of the element's
  3075.                         face is positioned midway between the
  3076.                         Background's top and bottom margins. The
  3077.                         element's Y value and all applicable Offset
  3078.                         commands are ignored.
  3079.  
  3080.             Bottom        The bottom edge of the element's face is
  3081.                         positioned at the Background's bottom margin.
  3082.                         The element's Y value and all applicable
  3083.                         Offset commands are ignored.
  3084.  
  3085.             If this option is not specified, the element's alignment
  3086.             defaults to (None, None).
  3087.  
  3088.         - Replace(state)
  3089.             This determines whether an element command will create a
  3090.             new element or replace an existing element previously
  3091.             created by the same command. If the state is On, the
  3092.             element command will replace the previous element created
  3093.             by the same command. If the state is Off, a new element
  3094.             will be created, and any previous elements created by the
  3095.             same command will remain on the screen. This defaults to
  3096.             Replace(On).
  3097.  
  3098.         - Frame(frame)
  3099.             Which image is to be used from the named file, if the file
  3100.             contains multiple images.
  3101.  
  3102.         - Operation(state, <operation options>)
  3103.             Specifies the operations done before drawing this image.
  3104.             The state defaults to off.
  3105.  
  3106. Text():
  3107.  
  3108.     This command creates a foreground object that is one or more words
  3109.     of text drawn with a specified font and effects.
  3110.  
  3111.     Text(X,Y,string,
  3112.         [ Wipe(wipename, <wipe options>) ]
  3113.         [ Face(state, <fill options>) ]
  3114.         [ Shift(x, y) ]
  3115.         [ Transparent(state) ]
  3116.         [ Border(left, right, top, bottom) ]
  3117.         [ Outline(state, Thickness(pixels), <fill options>) ]
  3118.         [ Backdrop(state, <fill options>) ]
  3119.         [ Bevel(state, Thickness(pixels), Base(color),
  3120.             Left(<fill options>), Right(<fill options>),
  3121.             Top(<fill options>), Bottom(<fill options>)) ]
  3122.         [ Shadow(state, Offset(horizontal, vertical), <fill options>) ]
  3123.         [ Align(horizontal, vertical) ]
  3124.         [ Replace(state) ]
  3125.         [ Append(string) ]
  3126.         [ Wrap(bool [,Width(w)] [,Auto(w)]) ]
  3127.         [ Justify(horizontal,vertical) ]
  3128.         [ Leading(value) ]
  3129.         [ Live(bool) ]
  3130.         [ Font(name, size) ]
  3131.         [ Italic(bool [,Delta(value)]) ]
  3132.         [ Bold(bool [,Delta(value)]) ]
  3133.         [ Kerning(enum) ]
  3134.         [ Spacing(value) ]
  3135.         [ Underline(bool
  3136.             [,Position(value)] [,Thickness(value)]
  3137.             [,Air(value)] [,Pen(pen)]) ]
  3138.         );
  3139.         
  3140.     Text() required parameters:
  3141.         - X
  3142.             The horizontal position of the element's face. This
  3143.             position may be modified by the effects of Offset commands
  3144.             in containing blocks, and by Foreground's Align option.
  3145.             See those options' descriptions for more details.
  3146.  
  3147.         - Y
  3148.             The vertical position of the element's face. This position
  3149.             may be modified by the effects of Offset commands in
  3150.             containing blocks, and by Foreground's Align option. See
  3151.             those options' descriptions for more details.
  3152.  
  3153.         - string
  3154.             A double quoted ASCII/Latin1 string of text to print.
  3155.  
  3156.     Optional parameters:
  3157.         - Wipe(wipename, <wipe options>)
  3158.             A description of the wipe used for wiping in the element.
  3159.             If no wipe is specified, the "Cut" wipe is used.
  3160.  
  3161.         - Face(state, <fill options>)
  3162.             The appearance of the face of the element. The state
  3163.             defaults to on. For images, <fill options> defaults to
  3164.             nothing. For other elements, <fill options> defaults to
  3165.             RGB($ffffff).
  3166.  
  3167.         - Shift(x, y)
  3168.             The amount the element's face, outline, and shadow are
  3169.             shifted from the specified element position. This is
  3170.             intended to be used for different button states to move
  3171.             the face without moving the backdrop or bevel. The offset
  3172.             values may be any numbers, and default to (0, 0).
  3173.  
  3174.         - Transparent(state)
  3175.             Whether or not pen zero is transparent. The state defaults
  3176.             to off. If this is on, any portion of the foreground
  3177.             element drawn in pen zero will not be visible, but will
  3178.             show through to the image beneath this foreground element.
  3179.  
  3180.         - Border(left, right, top, bottom)
  3181.             Extra space added to the edges of the element, measured in
  3182.             pixels. This effectively extends the element's bounding
  3183.             box without affecting the position of the element's face
  3184.             or the size of its face image. The border values may be 0
  3185.             or greater, and all default to 0.
  3186.  
  3187.         - Outline(state, Thickness(pixels), <fill options>)
  3188.             A colored outline added to the element. The state defaults
  3189.             to off. Thickness may be 1 or greater, and defaults to 1.
  3190.             <fill options> defaults to RGB(0).
  3191.  
  3192.         - Backdrop(state, <fill options>)
  3193.             The appearance of the bounding box of the element behind
  3194.             the face and other style options applied to the element.
  3195.             The state defaults to off. <fill options> defaults to
  3196.             RGB(0).
  3197.  
  3198.         - Bevel(state, Thickness(pixels), Base(color),
  3199.                 Left(<fill options>), Right(<fill options>),
  3200.                 Top(<fill options>), Bottom(<fill options>))
  3201.             A beveled edge added outside the element's bounding box.
  3202.             The state defaults to off. Thickness may be 1 or greater,
  3203.             and defaults to 2. Base is a hint to the authoring station
  3204.             to assist with choosing bevel colors, and is not used by
  3205.             the Screen EX otherwise. The Base color is specified as a
  3206.             4-byte hexadecimal number, where each byte encodes zero,
  3207.             red, green, and blue, from MSB to LSB. The bevel colors
  3208.             default to shades of grey.
  3209.  
  3210.         - Shadow(state, Offset(horizontal, vertical), <fill options>)
  3211.             A drop shadow drawn behind the element, drawn in a solid
  3212.             color. The state defaults to off. Either or both of the
  3213.             offsets can be positive or negative, and are measured in
  3214.             pixels. <fill options> defaults to RGB(0).
  3215.  
  3216.         - Align(horizontal, vertical)
  3217.             This determines whether the element is positioned based on
  3218.             its X,Y values, or by the Background's size and margins.
  3219.             These tables describe the alignment values and their
  3220.             meanings:
  3221.  
  3222.             Horizontal    Description
  3223.             ----------    -----------
  3224.             None        The left edge of the element's face is
  3225.                         positioned relative to the left edge of the
  3226.                         background. The element's X value and the
  3227.                         cumulative effect of all applicable Offset
  3228.                         commands are used for positioning the element.
  3229.  
  3230.             Left        The left edge of the element's face is
  3231.                         positioned at the Background's left margin.
  3232.                         The element's X value and all applicable
  3233.                         Offset commands are ignored.
  3234.  
  3235.             Center        The vertical centerline of the element's face
  3236.                         is positioned midway between the Background's
  3237.                         left and right margins. The element's X value
  3238.                         and all applicable Offset commands are
  3239.                         ignored.
  3240.  
  3241.             Right        The right edge of the element's face is
  3242.                         positioned at the Background's right margin.
  3243.                         The element's X value and all applicable
  3244.                         Offset commands are ignored.
  3245.  
  3246.             Vertical    Description
  3247.             --------    -----------
  3248.             None        The top edge of the element's face is
  3249.                         positioned relative to the left edge of the
  3250.                         background. The element's Y value and the
  3251.                         cumulative effect of all applicable Offset
  3252.                         commands are used for positioning the element.
  3253.  
  3254.             Top            The top edge of the element's face is
  3255.                         positioned at the Background's top margin. The
  3256.                         element's Y value and all applicable Offset
  3257.                         commands are ignored.
  3258.  
  3259.             Middle        The horizontal centerline of the element's
  3260.                         face is positioned midway between the
  3261.                         Background's top and bottom margins. The
  3262.                         element's Y value and all applicable Offset
  3263.                         commands are ignored.
  3264.  
  3265.             Bottom        The bottom edge of the element's face is
  3266.                         positioned at the Background's bottom margin.
  3267.                         The element's Y value and all applicable
  3268.                         Offset commands are ignored.
  3269.  
  3270.             If this option is not specified, the element's alignment
  3271.             defaults to (None, None).
  3272.  
  3273.         - Replace(state)
  3274.             This determines whether an element command will create a
  3275.             new element or replace an existing element previously
  3276.             created by the same command. If the state is On, the
  3277.             element command will replace the previous element created
  3278.             by the same command. If the state is Off, a new element
  3279.             will be created, and any previous elements created by the
  3280.             same command will remain on the screen. This defaults to
  3281.             Replace(On).
  3282.  
  3283.         - Append()
  3284.             May appear multiple times within the Text() command.
  3285.     
  3286.             Text can have style changes imbedded in the string data. These
  3287.             can be encoded by breaking the string into pieces within the same
  3288.             TEXT command using the APPEND option. Options that can be used
  3289.             within the TEXT command, and within the APPEND option are listed
  3290.             below. For every option that is not specified within an APPEND
  3291.             option, that option is inherited from the enclosing TEXT
  3292.             attributes. If an option is specified within an APPEND option,
  3293.             all of the defaults for that option take precedence if the
  3294.             sub-options are not specified within the option.
  3295.     
  3296.             APPEND(string)
  3297.                 string    - A double quoted ASCII/Latin1 string of text.
  3298.     
  3299.             Note that the authoring station will never generate an APPEND
  3300.             option that has no sub-options specified. It would be an
  3301.             inefficient way to encode the script.
  3302.     
  3303.         - Wrap()
  3304.             The Wrap() option is valid only within the Text() command.
  3305.             Because it affects the layout of all text in the Text() command,
  3306.             including any text in Append() options, it is not valid within an
  3307.             Append() option.
  3308.     
  3309.             DEFAULT: Word wrap is Off.
  3310.     
  3311.             WRAP(bool, <WIDTH(w)>, <AUTO(w)>)
  3312.                 bool    - "On" or "Off"
  3313.     
  3314.             Note that the authoring station will never generate both a WIDTH
  3315.             and an AUTO sub-option. If both are specified, AUTO takes
  3316.             precedence. The default is word-wrap is off. If the option is
  3317.             missing, or written as WRAP(), or written as WRAP(Off), these are
  3318.             all equivalent. If neither WIDTH or AUTO is specified, WRAP(On)
  3319.             is invalid by itself, and is treated as WRAP(Off).
  3320.     
  3321.             The Width() and Auto() sub-options are valid within a Wrap(On)
  3322.             option.
  3323.     
  3324.                 WIDTH(w)
  3325.                 AUTO(w)
  3326.                     w    - integer word-wrap width.
  3327.     
  3328.                 These sub-options are almost equivalent. Hand written
  3329.                 scripts will almost always use WIDTH, while authoring
  3330.                 generated scripts are more likely to use AUTO. AUTO has the
  3331.                 additional meaning that the wrap-width, and state are
  3332.                 uncommitted during authoring.
  3333.     
  3334.                 If word-wrap is set to Auto during editing (the default),
  3335.                 word-wrap is effectively on during the editing session. Then
  3336.                 if the text wrapped during the editing session, this
  3337.                 information is saved in the script as Wrap(On,Auto(width)),
  3338.                 and if it did not wrap, it is saved as
  3339.                 Wrap(Off,Auto(width)). This serves as a performance hint to
  3340.                 the playback engine because Wrap(Off) text renders somewhat
  3341.                 faster than word-wrapped text. The user wrap width are also
  3342.                 saved in the script in this way so that the same width is
  3343.                 used when the script is loaded again for editing.
  3344.     
  3345.                 The authoring station may also generate Wrap(On,Width()) if
  3346.                 the user selects word-wrap On in the styles menu. This is
  3347.                 primarily of use for script that have variables in the
  3348.                 strings so that word-wrap can be forced on, whether or not
  3349.                 the text wrapped during authoring.
  3350.     
  3351.                 If the user selects word-wrap Off in the styles menu, the
  3352.                 authoring station will not generate the WRAP option or any
  3353.                 of it's sub-options because this is the default. Setting
  3354.                 word-wrap to explicitly to Off is primarily of use for
  3355.                 scripts that have variables in the strings so that word-wrap
  3356.                 can be forced off, no matter how long the text is at
  3357.                 evaluation time. It is also the default, so that
  3358.                 hand-written scripts that commonly have single lines of
  3359.                 text, and no variables are encoded in the smallest form.
  3360.     
  3361.         - Justify()
  3362.             The Justify() option is valid only within the Text() command.
  3363.             Because it affects the layout of all text in the Text() command,
  3364.             including any text in Append() options, it is not valid within an
  3365.             Append() option. Note that the Text() Justify() option can be
  3366.             combined with the element Align() option to set the alignment of
  3367.             the text within the element (Justify) and the alignment of the
  3368.             element relative to the page margins (Align).
  3369.     
  3370.             DEFAULT: Text lines are left aligned, top position.
  3371.     
  3372.             JUSTIFY(horizontal,vertical)
  3373.                 horizontal - Left or Center or Right
  3374.                 vertical - Top or Middle or Bottom
  3375.     
  3376.             Note that full text justification is not currently supported, so
  3377.             this option is currently only supports left, center, or right
  3378.             alignment of multiline text. It can be specified for single line
  3379.             text, but has no visible effect.
  3380.     
  3381.             Vertical placement is not supported at this time.
  3382.     
  3383.         - Leading()
  3384.             The Leading() option is valid only within the Text() command.
  3385.             Because it affects the layout of all text in the Text() command,
  3386.             including any text in Append() options, it is not valid within an
  3387.             Append() option.
  3388.     
  3389.             DEFAULT: Zero (0) pixels of space between lines of text.
  3390.     
  3391.             LEADING(value)
  3392.                 value - A positive or negative integer.
  3393.     
  3394.             Used to add or subtract lines of pixels between lines of text
  3395.             within the same text element. It can be specified for single line
  3396.             text, but has no visible effect at playback time.
  3397.     
  3398.         - Live()
  3399.             The Live() option is valid only within the Text() command.
  3400.     
  3401.             DEFAULT: Live(On)
  3402.     
  3403.             LIVE(bool)
  3404.                 bool - On or Off
  3405.     
  3406.             The LIVE option is used to enable/disable playback time updating
  3407.             of variables. If On (the default), a text element will auto
  3408.             update if a variable in a string changes.
  3409.     
  3410.             Note that variables must be entirely within a string, in other
  3411.             words, it is not possible to change styles in the middle of a
  3412.             variable, though it is possible to have variables displayed in
  3413.             different styles in the same TEXT command by using the APPEND
  3414.             option.
  3415.     
  3416.         - Font()
  3417.             The Font() option is valid within the Text() command, or Append()
  3418.             option.
  3419.     
  3420.             DEFAULT: System dependent, but it is SFuturaX 24 for MM100, and
  3421.             will therefore stay that way in the future for compatability on
  3422.             DOS products.
  3423.     
  3424.             FONT(<name>, <size>)
  3425.                 name - Font name in double quotes such as "SCompact".
  3426.                 size - Integer size of font, in pixels.
  3427.     
  3428.             Note that for the bitmap fonts the font must be installed,
  3429.             matching both name and size else the Text() command will fail
  3430.             with an error set. Note that both name and size are required
  3431.             for the FONT option.
  3432.     
  3433.         - Italic()
  3434.             The Italic() option is valid within the Text() command, or
  3435.             Append() option.
  3436.     
  3437.             DEFAULT: By default, Italic is Off on all systems, though the
  3438.             default italic delta is system dependent (it is 16 on DOS
  3439.             platforms including MM100, 32 on the GI box)
  3440.     
  3441.             ITALIC(bool <DELTA(<value>)>)
  3442.                 bool - On or Off. If On, the DELTA sub-option can also be
  3443.                        specified.
  3444.     
  3445.             The ITALIC option is used to apply algorithmic slant to a font.
  3446.             It can be used to increase or decrease the slant of any font,
  3447.             including fonts that are designed as Italic.
  3448.     
  3449.             The Delta() sub-option is valid within an Italic(On) option.
  3450.     
  3451.                 DELTA(value)
  3452.                     value - An integer amount in the range of -99 to +99.
  3453.     
  3454.                 Negative numbers apply algorithmic backward (to the left
  3455.                 visually) slant to the glyphs in a font, positive numbers apply
  3456.                 forward slant. Examples include:
  3457.     
  3458.                     +99 - Approximately 1.5:1 slant ratio to the right.
  3459.                     +64 - 1:1 slant ratio (45 degrees) to the right.
  3460.                     +32 - 1:2 slant ratio to the right.
  3461.                     +16 - 1:4 slant ratio to the right.
  3462.                     +00 - No algolrithmic slant.
  3463.                     -16 - 1:4 slant ratio to the left.
  3464.                     -32 - 1:2 slant ratio to the left.
  3465.     
  3466.                 Very small slant amounts may not be visible (e.g., +1/-1)
  3467.                 depending on the height of the font.
  3468.     
  3469.         - Bold()
  3470.             The Bold() option is valid within the Text() command, or Append()
  3471.             option.
  3472.     
  3473.             DEFAULT: By default, Bold is Off on all systems, though the
  3474.             default bold delta is system dependent (it is 3 on DOS systems
  3475.             including MM100).
  3476.     
  3477.             BOLD(bool <DELTA(<value>)>)
  3478.                 bool - On or Off. If On, the DELTA sub-option can also be
  3479.                        specified.
  3480.     
  3481.             The BOLD option is used to apply algorithmic bold to a font. It
  3482.             can be used to increase the apparent boldness (weight) of any
  3483.             font, including those designed as light, normal, bold, extra
  3484.             bold, etc. Fonts that are made bolder in this way will not be any
  3485.             taller, but the glyphs will appear wider and thicker.
  3486.     
  3487.             The Delta() sub-option is valid within a Bold(On) option.
  3488.     
  3489.             DELTA(value)
  3490.                 value - An integer amount in the range of 1 to 9.
  3491.     
  3492.                 The delta values apply a calculation based on the weight of the
  3493.                 font and the delta value to calculate additional algorithmic
  3494.                 weight. This calculation performs rouding. Therefore a thinner
  3495.                 font such as SCompactL will support a greater range of visible
  3496.                 weight changes than would a heavier font such as SFuturaX.
  3497.                 Experiment to find values that look good to you.
  3498.     
  3499.         - Kerning()
  3500.             The Kerning() option is valid within the Text() command, or
  3501.             Append() option.
  3502.     
  3503.             DEFAULT: By default, Kerning is On, and applies to both
  3504.             alphabetic characters and numeric pairs on DOS systems including
  3505.             MM100.
  3506.     
  3507.             KERNING(enum)
  3508.                 enum - None or Alpha or AlphaNum.
  3509.     
  3510.             The KERNING option is used to apply kerning between character
  3511.             pairs. Valid character pairs for kerning are determined by the
  3512.             font, but usually include alphabetic character pairs, plus
  3513.             alphabetic characters followed by some symbols (usually
  3514.             punctuation marks). In addition, kerning can be enabled or
  3515.             disabled for numeric pairs. It is most often useful to turning
  3516.             numeric kerning off for tables or other text in which monospacing
  3517.             of the numeric glyphs is preferred. For standalone text, numeric
  3518.             pair kerning may look better.
  3519.     
  3520.             Example:
  3521.                 Text(20, 20, "a", Append("b", Kerning(None)), Append("cdef"));
  3522.     
  3523.             Note that kerning is between characters. Therefore in this
  3524.             example, "ab" are kerned, but "bc" are not kerned, and "cdef" are
  3525.             kerned.
  3526.     
  3527.         - Spacing()
  3528.             The Spacing() option is valid within the Text() command, or
  3529.             Append() option.
  3530.     
  3531.             DEFAULT: Zero (0) extra space between glyphs.
  3532.     
  3533.             SPACING(value)
  3534.                 value - -9 through +999
  3535.     
  3536.             The SPACING option is used to add/subtract an additional amount
  3537.             of pixel space between glyphs. It can be applied in addition to
  3538.             kerning to fine adjust spacing.
  3539.     
  3540.             Note that positive spacing at the end of lines is visually
  3541.             stripped, and does not contribute the size of the text element.
  3542.     
  3543.             Example:
  3544.                 Text(20, 20, "a", Append("b", Spacing(2)), Append("cdef"));
  3545.     
  3546.             Note that spacing is between characters. Therefore in this
  3547.             example, "ab" have 0 extra space, "bc" have 2 pixels of extra
  3548.             space, and "cdef" have 0 extra space between the glyphs.
  3549.     
  3550.         - Pen control options
  3551.             The following are pen control options, and have the same syntax
  3552.             as screen elements. They are valid within the Text() command, or
  3553.             Append() option.
  3554.     
  3555.                 FACE(bool, <Pen(pen)>)
  3556.                 OUTLINE(bool, <Thickness(value)>, <Pen(pen)>)
  3557.                 SHADOW(bool, <Offset(horizontal,vertical)>, <Pen(pen)>)
  3558.     
  3559.         - Underline()
  3560.             The Underline() option is valid within the Text() command, or
  3561.             Append() option.
  3562.     
  3563.             DEFAULT: Underline off.
  3564.     
  3565.             UNDERLINE(bool, <Position(value)>, <Thickness(value)>,
  3566.                             <Air(value)>, <Pen(pen)>)
  3567.                 bool - On or Off. If Off, sub-options have no visible effect.
  3568.     
  3569.             The Air() sub-option is valid within an Underline(On) option.
  3570.     
  3571.             DEFAULT: 1 pixel of air.
  3572.     
  3573.             AIR(value)
  3574.                 value - A positive integer with a range of 0 through 3
  3575.                 inclusive. Used to control the space between glyphs and
  3576.                 the underline bar. A value of 0 is a solid underline.
  3577.     
  3578.             The Position() sub-option is valid within an Underline(On)
  3579.             option.
  3580.     
  3581.             DEFAULT: Depends on font; often 1 pixel below the baseline.
  3582.     
  3583.             Position(value)
  3584.                 value - A positive or negative integer that is used to control
  3585.                 the underline bar position relative to the font's baseline.
  3586.     
  3587.                 Negative values move the underline start position above the
  3588.                 baseline, positive values below. A value of 0 places the
  3589.                 top of the underline bar at the baseline.
  3590.     
  3591.                 If the sub-option is not specified, the font's suggested
  3592.                 underline position is used.
  3593.     
  3594.             The Thickness() sub-option is valid within an Underline(On)
  3595.             option. DEFAULT: Depends on font.
  3596.     
  3597.             Thickness(value)
  3598.                 value - A positive integer that is used to control the
  3599.                 thickness of the underline bar in pixels.
  3600.     
  3601.                 If the sub-option is not specified, the font's suggested
  3602.                 underline thickness is used.
  3603.     
  3604.             The Pen() sub-option is valid within an Underline(On) option.
  3605.             DEFAULT: Same as face pen.
  3606.     
  3607.             Pen(value)
  3608.                 value - An indexed pen value. See FACE, OUTLINE, and SHADOW.
  3609.     
  3610.                 If the sub-option is not specified, the FACE pen is used for
  3611.                 the underline pen.
  3612.  
  3613.  
  3614. 3. Non-Element Commands
  3615. -----------------------
  3616.  
  3617. These are descriptions of other commands supported by the Screen EX
  3618. and related software. These commands do not create elements, but they
  3619. can affect elements that are displayed.
  3620.  
  3621. Offset():
  3622.  
  3623.     The Offset command, when used in the Group list of a Scala Script
  3624.     block, offsets the positions of all Foreground elements by the
  3625.     specified offset amount. If Offset commands are used in nested
  3626.     blocks, the net result of each Offset command is added together
  3627.     to determine the effective offset for Foreground elements in the
  3628.     most nested block. The effect of having an Offset command in a
  3629.     group list between several foreground elements is undefined.
  3630.  
  3631.     This command is useful when grouping related Foreground elements
  3632.     so the group can be moved around easily during authoring. The
  3633.     Offset command can be used for positioning the group, and
  3634.     Foreground elements within the group are positioned relative to
  3635.     the group's effective position, taking into account the offsets
  3636.     of all nested groups.
  3637.  
  3638.     Offset(X,Y);
  3639.  
  3640.     Offset() required parameters:
  3641.         - X
  3642.             The horizontal offset, relative to the left edge of the
  3643.             background.
  3644.  
  3645.         - Y
  3646.             The vertical offset, relative to the top edge of the
  3647.             background.
  3648.  
  3649. Preload():
  3650.  
  3651.     (supports only one filename at a time so far)
  3652.     The Preload command obtains a SnapScope object for each file
  3653.     listed on its command line during its Do_EVENT_Make method, and
  3654.     releases these objects during its Do_EVENT_End method.
  3655.  
  3656.     Preload(filename);
  3657.  
  3658.     Examples:
  3659.         Preload(":scala/pictures/kjell.flc");
  3660.         Preload(":scala/pictures/oyvind.bmp", ":scala/pictures/lars.bmp");
  3661.  
  3662.     Preload() required parameters:
  3663.         - filename
  3664.             The name of a file to be loaded. The file must be in a
  3665.             format supported by the currently loaded set of SnapLoad
  3666.             parsers. One or more filenames may be specified. If more
  3667.             than one filename is specified, they must be separated by
  3668.             commas.
  3669.  
  3670. WipeOut():
  3671.  
  3672.     The WipeOut command wipes out an element that has been wiped in.
  3673.  
  3674.     WipeOut(elementname,
  3675.         [ Wipe(wipename, <wipe options>) ]
  3676.         );
  3677.  
  3678.     WipeOut() required parameters:
  3679.         - elementname
  3680.             The script label of the command that created the
  3681.             foreground element to be wiped out, or the label of a
  3682.             block containing at least one foreground element to be
  3683.             wiped out.
  3684.  
  3685.     Optional parameters:
  3686.         - Wipe(wipename, <wipe options>)
  3687.             A description of the wipe used for wiping out the element.
  3688.  
  3689. 4. Option Groups
  3690. ----------------
  3691.  
  3692. These are descriptions of the option groups that are used in several
  3693. different classes. Rather than repeat the descriptions for each class
  3694. that supports these options, this section describes them once.
  3695.  
  3696. <fill options>:
  3697.  
  3698.     There are several fill options, only one of which can be used at a
  3699.     time. If none of these options are used, the behaviour depends on
  3700.     the element.
  3701.  
  3702.         - Pen(pen)
  3703.             A pen used for filling the specified area.
  3704.  
  3705.         - RGB(color)
  3706.             A solid color used for filling the specified area. This
  3707.             is not used directly, but the closest matching pen from the
  3708.             current background's palette is used.
  3709.  
  3710.         - Tile(filename, Frame(frame),
  3711.                 Operation(<operation options>),
  3712.                 Justify(horizontal, vertical),
  3713.                 Offset(direction, amount))
  3714.             (implemented only for Box, Display, and Foreground's Backdrop)
  3715.             Specifies an image to be tiled onto the specified area,
  3716.             and options describing how it is to be tiled.
  3717.  
  3718.             Filename specifies the name of the file containing the
  3719.             image data to be used. This image file may be a stretcher
  3720.             file or a standard bitmap file.
  3721.  
  3722.             Frame specifies which image is to be used from
  3723.             the named file, if the file contains multiple images.
  3724.  
  3725.             Justify(horizontal, vertical) specifies how the image is
  3726.             justified when tiling.
  3727.  
  3728.             Offset(direction, amount) specifies the offset for the
  3729.             tiled image from one row (or column) to the next.
  3730.  
  3731.         - Image(filename, Frame(frame), Operation(<operation options>))
  3732.             (implemented only for Box, Display, and Foreground's Backdrop)
  3733.             Specifies an image to be drawn into the specified area.
  3734.             The image will be sized to fit the filled area, using an
  3735.             appropriate scaling method for the source image.
  3736.  
  3737.             Filename specifies the name of the file containing the
  3738.             image data to be used. This image file may be a stretcher
  3739.             file or a standard bitmap file.
  3740.  
  3741.             Frame specifies which image is to be used from
  3742.             the named file, if the file contains multiple images.
  3743.  
  3744. <operation options>:
  3745.  
  3746.     There are several operation options, which may be used in
  3747.     combination. The options specified are applied in this order:
  3748.  
  3749.         - Crop(left, top, width, height)
  3750.             A sub-part of the image to be displayed. By default, the
  3751.             image is not cropped and the entire source image is used.
  3752.  
  3753.         - Flip(horizontal, vertical)
  3754.             (vertical flip not implemented yet)
  3755.             Flip the source image in the horizontal and/or vertical
  3756.             direction before using it for drawing the element. This
  3757.             defaults to Flip(off, off).
  3758.  
  3759.         - Rotate(angle)
  3760.             Rotate the source image clockwise the specified angle
  3761.             before using it for drawing the element. The angle is
  3762.             specified in degrees clockwise from North, and is limited
  3763.             to the range 0 through 359, inclusive.
  3764.  
  3765.         - Resize(width, height)
  3766.             Scale the image, using absolute scaling.
  3767.  
  3768.             Width indicates the new width in pixels for the image.
  3769.             This may be 1 or greater, and defaults to the nominal
  3770.             width of the image.
  3771.  
  3772.             Height indicates the new height in pixels for the image.
  3773.             This may be 1 or greater, and defaults to the nominal
  3774.             height of the image.
  3775.  
  3776.         - ImagePalette( MapToZero(pen,pen,pen...), <palette options> )
  3777.             Remap one or more pens in the source image to the pens
  3778.             from the current background's palette that most closely
  3779.             match the specified colors.
  3780.  
  3781.             MapToZero(pen,pen,pen...) is used to map one or more pens
  3782.             in the source image to pen zero so they will show through
  3783.             to the graphics beneath the element when the image is
  3784.             drawn with the Transparent(on) option.
  3785.  
  3786.         - Dither(state, Auto(autostate))
  3787.             Use Floyd-Steinberg dithering to make the source image
  3788.             more closely match its original coloring using the current
  3789.             background's palette. This defaults to off.
  3790.  
  3791.             Auto(autostate) is used to tell the software to ignore the
  3792.             Dither state provided, and to determine the dither state
  3793.             based on whether the image is a true color image. If
  3794.             autostate is on and the image is a true color image, then
  3795.             the image will be dithered. If autostate is on and the
  3796.             image is not a true color image, the image will not be
  3797.             dithered. If autostate is off, then the supplied dither
  3798.             state will be used. Autostate defaults to off.
  3799.  
  3800. <palette options>:
  3801.  
  3802.     There is one palette option, which may be repeated as many times
  3803.     as needed. If a Palette option is specified on a style command and
  3804.     an element command that references that style, both will be used
  3805.     in this way: first, the palette will be set from the style's
  3806.     Palette option, then from the element command's Palette option. If
  3807.     a pen is set more than once, the last color set for the pen will
  3808.     be used.
  3809.  
  3810.         - RGBPen(pen, color, ...)
  3811.             Set a specific pen to a specific color. Color is specified
  3812.             as a 3-byte hexadecimal number, where each byte encodes
  3813.             red, green, and blue, from MSB to LSB.
  3814.             Color may be repeated. If more than one color is
  3815.             specified, each color is assigned to the next consecutive pen,
  3816.             starting at the specified pen.
  3817.  
  3818. <wipe options>:
  3819.  
  3820.     These wipe options may be used in any combination. Some wipes may
  3821.     impose certain restrictions on the values of these options, and
  3822.     may ignore some other options altogether.
  3823.  
  3824.         - Speed(value)
  3825.             Indicates a subjective speed for the wipe. The value may
  3826.             range from 1 (slow) to 10 (fast) for most wipes, and
  3827.             defaults to 5. Some wipes may allow speeds outside the
  3828.             range 1-10. In all cases, the number chosen will be used
  3829.             as a guide for the Screen EX to choose a wipe wpeed that
  3830.             results in a smooth wipe.
  3831.  
  3832.         - Angle(degrees)
  3833.             Indicates the direction of travel for the wipe. Degrees
  3834.             may be any angle from 0 to 359 degrees, (starting at North
  3835.             and increasing clockwise), and defaults to 270 degrees
  3836.             (West). For script wipes, degrees will be rounded to the
  3837.             nearest 90-degree increment.
  3838.  
  3839.         - Flip(horizontal, vertical)
  3840.             Indicates whether the wipe is flipped horizontally and/or
  3841.             vertically. This defaults to Flip(off, off).
  3842.