XYplorer 15.40 has been released on 22-Jun-2015. Here’s a quick introduction to the main new features:
User-Defined Functions. Finally scripting brings you the biggest fun in programming: You can roll your own functions now. (Pro Edition Only)
A user-defined function (or simply "user function") is a block of statements that can be used repeatedly in a program. It can return a value (using the command "return"). The function declaration starts with the word "function", then a space, then the name of the function.
General form:
function functionName(arguments) { code to be executed; }
Example with two arguments and a return value:
function min($x, $y) { if ($x < $y) { return $x; } else { return $y; } }
You would call the above min() function like this:
echo min(42, 23); //returns 23
There is a lot you can do with user functions. It opens a whole new dimension to automated file management. See the Help file for details, options, and examples.
Scripting with Include. The new include statement enables you to include function libraries or whatever other files into the executing script. (Pro Edition Only)
Together with user functions the include statement allows you to build up function libraries that are easily shared between your scripts.
Example (loaded script):
include "math.inc"; echo multiply(3, 4) + divide(9, 3); // 12 + 3 = 15
Example (included library "math.inc"):
// math.inc function sum($x, $y) { return $x + $y; } function diff($x, $y) { return $x - $y; } function multiply($x, $y) { return $x * $y; } function divide($x, $y) { return $x / $y; }
Include statements can be nested (included files can themselves include other files). The maximum nesting level for Include statements is 100 (one hundred). You will get an error if you go beyond. Beware of recursion: A file must not include itself or any file by which it has been included, else you will reach the maximum nesting level within the next millisecond...
The include_once statement is identical to the include statement, with the only difference being that if the code from a file has already been included, it will not be included again. There are no errors or messages. Trying to include_once an already included file will simply ignore the statement and continue.
Copy File Size. Quickly copy a file's size in various formats.
Now when you hold CTRL and right-click a cell in the Size column the cell's context menu shows a number of common size display formats (RAW, Bytes, KB, MB, GB) of the file's size, ready to be copied to the clipboard.
Don't know about your time, but it will surely save some of mine.
Age Display Limit. Now you can show the age for today's files, the absolute date for all other files.
Simply enter "d" (w/o the quotes) into Configuration | Styles | Show Age maximum hours.
Other possible values: h (hour), w (week), m (month), q (quarter), y (year).
Note that Tools | Customize List | Date Column Format | Show Age (Ctrl+Shift+E) has to be enabled as well; this is the master switch for Age being shown in the List.