Code: Select all
v9.70.0007 - 2010-11-11 13:29
+ Configuration | Startup & Exit: Added dropdown "Startup pane".
Allows you to always start on a certain pane, or on the last pane
(factory default).
+ Scripting got a new function.
Name: formatbytes
Action: Formats a number as bytes, resp. converts byte formats.
Syntax: formatbytes(bytes, [format=FLEX], [decimals=-1])
bytes: The number to format.
Can be a raw number or a string like "2 KB".
format: The desired formatting. One of the following:
FLEX = [Default] Flexible (best unit is auto-selected).
FLEXR = FLEX, but rounded up.
KB, MB, GB, TB, or PB = usual bytes unit.
KBR = KB, but rounded up.
BB = Bytes (with unit)
B = Bytes (no unit)
RAW = Raw number (no unit, no thousand separators).
decimals: The number of decimal points.
Ignored if the unit is B, BB, KBR, or FLEXR.
-1 = System default.
return: Formatted number.
Remarks:
- The returned numbers are rounded to 2 digits and have thousand
separators (unless "R" is stated as format).
- Note that the function is locale-specific! Decimal and thousand
separators may be different from locale to locale.
Examples for US locale:
::text formatbytes("1.34 MB", "KB"); //1,372.16 KB
::text formatbytes("1,372.16 KB", "MB"); //1.34 MB
Examples for German locale:
::text formatbytes("1,34 MB", "KB"); //1.372,16 KB
::text formatbytes("1.372,16 KB", "MB"); //1,34 MB
More examples for German locale:
::text formatbytes("2 kb", "b"); //2.048
::text formatbytes("2 kb", "bb"); //2.048 bytes
::text formatbytes(2560); //2,50 KB
::text formatbytes("2560"); //2,50 KB
::text formatbytes("2560", "FLEX"); //2,50 KB
::text formatbytes("2560", "FLEXR"); //3 KB
::text formatbytes(2048 * 1024); //2,00 MB
::text formatbytes(2048 * 1024 . "KB"); //2,00 GB
::text formatbytes("1,5 MB", "RAW"); //1572864
Rounding (German locale):
::text formatbytes(1, "KB"); //0,00 KB
::text formatbytes(1, "KB", 0); //0 KB
::text formatbytes(1, "KB", 2); //0,00 KB
::text formatbytes(1, "KBR"); //1 KB
::text formatbytes(512, "KB"); // 0,50 KB
::text formatbytes(512, "KB", 0); // 1 KB
::text formatbytes(512, "KB", 2); // 0,50 KB
::text formatbytes(512, "KBR"); // 1 KB
+ Scripting got a new function.
Name: listpane
Action: Lists the contents of a pane.
Syntax: listpane([pane=<curpane>], [pattern=*], [flags], _
[separator="|"])
pane: Pane to list.
a = [default] active pane
i = inactive pane
1 = pane 1
2 = pane 2
pattern: Wildcard (?, *) pattern to filter returned items;
defaults to "*" (show all).
If no wildcards are contained, the pattern is auto-
embraced by "*".
flags: (binary field)
0: return folders and files with full paths [default]
1: NoFolders (= return only files)
2: NoFiles (= return only folders)
4: NoPaths (= return the filenames without paths)
separator: Separates the items in the returned list;
defaults to | (pipe).
return: List of items.
Notes:
- As you might have noted, this command is analogue to SC
listfolder with the exception of the first argument.
- The command also works on Search Results, Drives, Recycle Bin
and whatever list modes we will get int he future.
- The order of items is determined by the current list order.
- The possibilities this command brings to scripting are mind-
boggling.
Examples:
::inputselect("Items on pane 1", listpane(1));
::inputselect("Items on pane 2", listpane(2));
::inputselect("Items on active pane", listpane());
::inputselect("Items on inactive pane", listpane("i"));
::inputselect("Items a* on active pane", listpane(, "a*"));
* Logging To File: Well, from now on, the setting IS remembered
across sessions again IF it was set by ::logtofile. Logging set by
command switch /log=... is not remembered.
Note that both ways of setting the logging can be done
simultaneously: their values will be combined (bitwise OR-ed). So
when ::logtofile 1 has been set, and you start the app with
/log=2, then both events, eLTFBackgroundJobAdded (1) and
eLTFBackgroundJobTriggered (2) are logged.
! Scripting: The Math parser got stuff like this wrong:
::echo 3 * 3 . 3 * 3;
This should be analyzed as (3 * 3) . (3 * 3) = 9 . 9 = "99",
but the parser returned a very different result! Fixed.