Change Log for the latest
XYplorer BETA version:
Code: Select all
v15.00.0313 - 2015-04-10 16:40
+ Scripting: Added basic namespaces. You can define a namespace in script
resources using the new "namespace" statement, and later use the namespace
name to refer to functions (and particularly disambiguate functions with
the same name) by prepending it to the function name separated by "::".
No time for extensive documentation at the moment (the weather is just
too good), but these examples should do:
Example 1
~~~~~~~~~
Loaded script:
"Test sum"
echo sum(1, 2, 3); //3; calls the first sum function
"Test math::sum"
echo math::sum(1, 2, 3); //3; calls the first sum function in namespace "math"
"Test math2::sum"
echo math2::sum(1, 2, 3); //6; calls the first sum function in namespace "math2"
include "math.inc"
include "math2.inc"
Included library math.inc:
namespace "math"
function sum($x, $y) { return $x + $y; }
Included library math2.inc:
namespace "math2"
function sum($x, $y, $z) { return $x + $y + $z; }
Example 2
~~~~~~~~~
You can have more than one "namespace" statements in one resource:
Loaded script:
"Test sum"
echo sum(1, 2, 3); //3; calls the first sum function
"Test math::sum"
echo math::sum(1, 2, 3); //3; calls the first sum function in namespace "math"
"Test math2::sum"
echo math2::sum(1, 2, 3); //6; calls the first sum function in namespace "math2"
include "math3.inc"
Included library math3.inc:
namespace "math"
function sum($x, $y) { return $x + $y; }
namespace "math2"
function sum($x, $y, $z) { return $x + $y + $z; }
Example 3
~~~~~~~~~
There is a reserved namespace "xy" to refer to XY native functions:
echo xy::asc("a"); //97
Normally you can skip this, but it can become useful when your user
function names collide with native functions:
echo asc("a"); //ASC=97
echo xy::asc("a"); //97
function asc($a) { return "ASC=" . xy::asc($a) }
- Scripting: Removed automatic unindent from factory defaults. If you still
want it tweak it:
ScriptUnindent=1
! Scripting: Automatic unindent was too aggressive on lines that could not
be unindented as required. Now, if any such lines exist, the whole
unindent is canceled.
To
download the latest BETA version choose a download package: (1)
Installer Package, (2)
No-Install Package.
Note that BETA versions are work in progress and might contain fresh bugs. You have been warned.
It's a good idea to backup your complete XYplorer settings (menu File | Settings Special | Backup Application Data Folder...)
before running a new BETA version. This will also help in fixing any fresh bugs.