There's really currently nothing else, except what is written in documentation.
Will make a basic classification of all functions.
Condition1.
If(True/False, Then, Else)
FormatBoolean(True/False, Then, Else) = If()
Validation (output: Boolean value)
2.
IsEqual() IsEmpty([Field]) = IsEqual([Field],)
3.
IsRange()4.
IsMissing()Calculated Fields as "Functions" (Functions which outputs same data as regular Calculated [Fields])
AlbumArtist() = [Album Artist (auto)]
AlbumType() = [Album Type]
FileName() = [Filename (name)]
FilePath() = [Filename (path)]
FileVolume() = [Volume Name]
Size() = [File Size]
IsRemovable() = [Removable]
Strings5.
Clean() Inconsistently working function:
Removes following Leading/Trailing Characters: Spaces; -
Removes following Character Groups: []; ()
Doesn't remove following characters/groups: SingleBracket; |; /(/); {}
Will Clean Trailing brackets /(/) if there's at least one space character before the closing function bracket.
Ex. : Will Remove: Clean(/([Field]/) )
Ex.2 : Will Not Remove: Clean(/([Field]/))
Doesn't remove Trailing Space when a Closing square bracket is after the Function's Bracket.
Ex. : [Clean(Text )]Text
Ex.2 : Clean(Text )Text
6.
FixCase()7.
FormatDate()8.
Mid()As you can see, the whole "language" consists only from 8 functions, regardless of documentation complications. Other "functions" are simply duplicate each other or are alternatives to regular already accessible Calculated Factory Default [Fields], which in fact, can't be deleted, in spite of there are already equivalent functions. And, there's really nothing more to say.
But, even with this overlimited amount of functions it is possible to build heavily complex expressions by having hundreds of nested conditions thanks to the if() conditional statement. Of course writing expressions could be simplified by adding at least possibility to expand the single-line expression to a multi-line script. But, currently JRiver just don't have time to work on a parser.
Now, answers
1. How do I handle spaces in expressions
Currently this behaviour is not documented. Peoples can recognize the behaviour only after experimenting. So, the rule:
You can add Leading space characters of any quantity in any Function after commas, as they're all removed at Expression evaluation.
You can add Leading space characters of any quantity
in some cases after opening parenthesis, as they're all removed at Expression evaluation.
You should not add Trailing space characters before closing parenthesis, commas, as they're actually considered as spaces.
Examples by following the rule:
IsEqual( [Artist], Abba) = TRUE
IsEqual([Artist],Abba) = TRUE
IsEqual([Artist], Abba) = TRUE
IsEqual([Artist] , Abba) = FALSE
IsEqual([Artist],Abba ) = FALSE
IsEqual([Artist], Abba) = TRUE
Perhaps this was decided for the sake of readability, even if this makes some inevitable inconveniences.
Currently there is no way to enclose strings with single (') or double (") quotes
2. What is meant by 'searches' - expressions don't work in the search bar...?
They're, actually, work. But they're totally different from those, which are used in View Schemes and "Rename Files from Properties" dialog.
The similarity with Excel, is that the Expression should start with equality character "=". But there also should be added an opening bracket.
The Expression consist from 2 sides (Left and Right) and should have a regular mathematic expression in form
[=Function(PARAM1,PARAM2)]=Function(PARAM1,PARAM2)
You can use any Functions or Fields on neither sides. The primary difference from Expressions in other parts of the Software is that you can build and compare two Expressions to receive a True/False result. There can be only a Boolean result after evaluating this expression:
1, when Left Side = Right Side
0, when Left Side <> Right Side
MC in ultra speed will calculate the expression for each DB Entry (for each file in your Library), and will show those files, for which the calculation results in "True" (1) value.
The SearchBar-Expression is a kind of conditional statement. To make it clear, I will compare this behaviour to regular If() function:
If( [Function(PARAM1,PARAM2)]=Function(PARAM1,PARAM2), Show DB Entry in List View, Don't Show)
Now some examples:The 1st meaningful expression I saw on INTERACT. Following will show All Missing Files:
[=IsMissing([FileName])]=1
To show only songs of artists, names of which starts from A to C:
[=IsRange([Artist], a-c)]=1
To show only songs of artists, names of which starts from D, J-K, Z:
[=IsRange([Artist], d-d)]=1 or [=IsRange([Artist], j-k)]=1 or [=IsRange([Artist], z-z)]=1
OR
[=If(IsRange([Artist], d-d),1, If(IsRange([Artist], j-k),1, If(IsRange([Artist], z-z),1, ) ) ]=1
Notice that you
can't use "True" or "False" keywords on neither side.
Until now I didn't tried to use Expressions on both sides of Boolean Expression, and I thought that it is certainly can be written on both sides. But, after many experimentations, I have come to conclusion, that Currently Expression can be only on Left Side. So,
forget about expressions on both sides of Boolean ExpressionAny of following SearchBar-Expressions are
invalid:
1=[=IsRange([Artist], a-c)]
[1=[=IsRange([Artist], a-c)]
[=1=[=IsRange([Artist], a-c)]
[=IsRange([Artist], a-c)=IsRange([Artist], a-c)]
[=Function(PARAM1,PARAM2)]=Function(PARAM1,PARAM2)
3. Is it possible to use lists of values in expressions?
There are no Parsing functions in the language yet. You can't create arrays. There are even no Variable support! You really have only the If().
In your example the problem can be solved in following form (remove @CRLF's):
If(
IsEqual([Artist], Abba),
,Too embarrassing
,If(
IsEqual([Artist], William Shatner),
,Too embarrassing
,If(
IsEqual([Artist], William),
,Too embarrassing
,[Artist]
)
)
)
As you can see, because of lack of functions, this simple Expression can be a nightmare for 500 artists. But if you would need to create such an expression for 500 artists, then better to develop such an expression with another Scripting/Macros language, which contain string-related functions to parse a character-delimited string and concatenate an MC-Valid DBExpression (Ex. with VBScript, VBA, WinBatch, Macro ToolsWorks, etc.).
Alternatively you can create a [New Field], call it [Too embarrassing], put any characters to this field for all songs of each artist, then create a single-line expression:
If( IsEqual([Too embarassing],), [Artist],Too embarrassing)
The Editable Expressions idea for MC Database is currently is still in Draft state. The "Language" wasn't designed carefully. Hopefully it will be totally rewritten from ground up with all above considerations.