
                    Scriptol Level II Reference Manual
                         (c) 2002 D.G.Sureau

-----------------------------------------------------------------------
  The level I of the compiler is a (very improved) classical procedural
language. The level II will implement some innovative structures that may
be considered as experimental. The level II of the compiler is in works.
  Here are just some elements already implemented.
-----------------------------------------------------------------------

Dynamic variable

 One can convert a typed variable to dynamic with the method setDyn(), and
a dynamic variable to any type with setBoolean(), setInt(), setReal(),
setText(), setArray(), setDict(), setFile(), setFunction(), setObject().
 These functions don't change the content of the variable.


Conditional assignment

 This special assignment is intended to change a property or other variable
that has already a default value, when a new value is given.
 The := symbol assign conditionally a variable, if the expression is not
nil or if the variable is not initialized.
 The error flag is set to false if the expression to assign is nil.
 Example:
 int x := z
 error ? print "z is nil"
 The above assignment is equivalent to:
 if (x = null) or (z <> nil) ? x = z
 Only simple assignments may be conditional and use the := symbol.



The match operator

 The match operator performs a test with a choosen function assigned by
the "define" statement. It returns a boolean value.
 Syntax:
 define match [swap] as "function"
 Ex: define match swap as "ereg"
 The "swap" option means the two arguments must be inverted. If omitted, the
arguments are passed in the same order.
 Ex: define match as "strnatcmp"
 if (a match b) = false ? print "same"

 The default match function is "strstr" and there is swaping also by default.
Ex:
  if "x"
  match "xx" : print "found"
  match "ax" : print "found"
  else: print "nofound"
  /if

Ex:
  if x match y ? print "found"
  if x not match y ? print "no found"
 With the strstr function, the two terms must be expressions that evaluate in
texts.


