|
|
(5 intermediate revisions by the same user not shown) |
Line 104: |
Line 104: |
| : Returns ● | | : Returns ● |
| }} | | }} |
− |
| |
− | === <span id="Counter">Counter(…)</span> ===
| |
− | : Counts upwards in specified increments.
| |
− |
| |
− | {| style="width: 100%; border-spacing: 0; border: 0px solid black;" align="top" cellpadding="3" cellspacing="0"
| |
− | |- id="Counter" valign="top"
| |
− | ! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 2px 1px 0 2px; border-right: 1px solid #bbb;" width="100" | Description
| |
− | | style="background: #f9f9f9; color: #111; border-style: solid; border-width: 2px 2px 0 0" width="1200" | <span style="font-family: monospace,monospace; font-size:1em; color:#0f3f8d; font-size:110%"><b>counter(</b><i>start value</i><b>, </b><i>increment</i><b>)</b></span>
| |
− | The [[#Counter|Counter()]] function outputs a monotonically increasing number (more simply stated, it counts) from a <i>start value</i>,
| |
− | and each time called, increases by the <i>increment</i> value.
| |
− | It is useful for sequentially numbering fields.
| |
− | The [[#Counter|Counter()]] function maintains an internal counter, and it resets itself to zero after five seconds of inactivity.
| |
− |
| |
− | Because [[#Counter|Counter()]] continues to count, it should only be used in single-use situations such as assigning its output to some field through field value assignment, for example, <span style="font-family: monospace,monospace; font-size:1em;">=counter()</span>.
| |
− | With proper care, it can be used as part of an expression in the Rename, Move & Copy tool, but see also [[#CustomData|CustomData()]].
| |
− |
| |
− | It is not recommended for use in any context that continually refreshes its content, such as in a panes column, file list, or expression-based custom query.
| |
− | Probably the best way to understand the results is to test the first example below as an expression column in a file list, and move the mouse around over that column.
| |
− |
| |
− | Argument <i>start value</i> is optional (defaults to 1).
| |
− |
| |
− | Argument <i>increment</i> is optional (defaults to 1).
| |
− |
| |
− | |- valign="top"
| |
− | ! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 0px 1px 2px 2px; border-top: 1px solid #bbb; border-right: 1px solid #bbb;" | Examples
| |
− | |style="background: #f9f9f9; color: #111; border-style: solid; border-width: 0px 2px 2px 0; border-top: 1px solid #bbb;" | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>counter()</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">Outputs values starting at <span style="font-family: monospace,monospace; font-size:1em;">1</span>, and incrementing by one, it will return <span style="font-family: monospace,monospace; font-size:1em;">1</span>, <span style="font-family: monospace,monospace; font-size:1em;">2</span>, <span style="font-family: monospace,monospace; font-size:1em;">3</span>, ... until no longer called.
| |
− | This might be used, for example, to assign to the [Track #] field of several tracks using the field assignment expression <span style="font-family: monospace,monospace; font-size:1em;">=counter()</span>.</p>
| |
− | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>padnumber(counter(370, 2), 4)</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">Outputs numbers beginning from 370, incremented by two each, and padded to four digits. For example, <span style="font-family: monospace,monospace; font-size:1em;">0370</span>, <span style="font-family: monospace,monospace; font-size:1em;">0372</span>, <span style="font-family: monospace,monospace; font-size:1em;">0374</span>, etc.</p>
| |
− | |}
| |
− | <div style="text-align:right;">([[#top|Back to top)]]</div>
| |
| | | |
| === <span id="CustomData">CustomData(…)</span> === | | === <span id="CustomData">CustomData(…)</span> === |
Line 174: |
Line 142: |
| <p style="margin-left:20pt;">In and of itself, you might think that this is not 'all that', however, remember that we can combine this with other functions, thus giving us the ability to create expressions with playlist rules. A simple example would be:</p> | | <p style="margin-left:20pt;">In and of itself, you might think that this is not 'all that', however, remember that we can combine this with other functions, thus giving us the ability to create expressions with playlist rules. A simple example would be:</p> |
| <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>[=IsEqual(fileplaylists(),genre,8)]=1</nowiki></b></span> | | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>[=IsEqual(fileplaylists(),genre,8)]=1</nowiki></b></span> |
− | <p style="margin-left:20pt;">which when used in the search bar, will return all files that appear on a playlist called 'Genre'</p> | + | <p style="margin-left:20pt;">which when used in the search bar, will return all files that appear on any playlist containing 'Genre' in its name</p> |
| |} | | |} |
| <div style="text-align:right;">([[#top|Back to top)]]</div> | | <div style="text-align:right;">([[#top|Back to top)]]</div> |
| | | |
− | === <span id="Math">Math(…)</span> === | + | === <span id="Literal">Literal(…)</span> === |
− | : Evaluates a given mathematical formula. | + | : Returns a string as given without any formatting or processing |
− | | |
− | {| style="width: 100%; border-spacing: 0; border: 0px solid black;" align="top" cellpadding="3" cellspacing="0"
| |
− | |- id="Math" valign="top"
| |
− | ! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 2px 1px 0 2px; border-right: 1px solid #bbb;" width="100" | Description
| |
− | | style="background: #f9f9f9; color: #111; border-style: solid; border-width: 2px 2px 0 0" width="1200" | <span style="font-family: monospace,monospace; font-size:1em; color:#0f3f8d; font-size:110%"><b>math(</b><i>expression</i><b>)</b></span>
| |
− | The [[#Math|Math()]] function performs mathematical calculations.
| |
− | Standard arithmetic operators are supported, as are various numerical, trigonometric, and comparative functions.
| |
− | Simple variables are supported, as are multiple statements.
| |
− | | |
− | <blockquote>
| |
− | {| style="background: #f9f9f9;" border="1" cellpadding="1" cellspacing="0"
| |
− | | rowspan="6" width="100" valign="top" | '''Arithmetic Operators'''
| |
− | | align="center" width="65" | + || Addition
| |
− | |-
| |
− | | align="center" | - || Subtraction
| |
− | |-
| |
− | | align="center" | * || Multiplication
| |
− | |-
| |
− | | align="center" | / || Division
| |
− | |-
| |
− | | align="center" | ^ || Power
| |
− | |-
| |
− | | align="center" | % || Modulo
| |
− | |-
| |
− | | rowspan="3" | '''Boolean Operators'''
| |
− | | align="center" | ! || NOT
| |
− | |-
| |
− | | align="center" | & || AND
| |
− | |-
| |
− | | align="center" | <nowiki>|</nowiki> || OR
| |
− | |-
| |
− | | rowspan="1" | '''Grouping Operators'''
| |
− | | align="center" | ( ) || Precedence grouping
| |
− | |-
| |
− | | rowspan="4" | '''Comparison Operators'''
| |
− | | align="center" | } || Absolute value maximum (i.e. x or y that is maximum distance from 0).
| |
− | |-
| |
− | | align="center" | { || Absolute value minimum (i.e. x or y that is minimum distance from 0).
| |
− | |-
| |
− | | align="center" | > || Distance between x and y, positive when x greater than y, negative otherwise.
| |
− | |-
| |
− | | align="center" | < || Distance between x and y, positive when x less than y, negative otherwise.
| |
− | |-
| |
− | | rowspan="7" | '''Functions'''
| |
− | | align="center" | abs(x) || Returns the absolute value of x.
| |
− | |-
| |
− | | align="center" | sign(x) || Returns the sign of x (1 when x >= 0, -1 when x < 0).
| |
− | |-
| |
− | | align="center" | log(x) || Returns the natural logarithm (base e) of x.
| |
− | |-
| |
− | | align="center" | log10(x) || Returns the common logarithm (base 10) of x.
| |
− | |-
| |
− | | align="center" | pow(x,y) || Returns x raised to the y-th power.
| |
− | |-
| |
− | | align="center" | rand(x,y) || Returns a random value ranging between x and y.
| |
− | |-
| |
− | | align="center" | randn(x) || Returns a random value ranging between -x and x.
| |
− | |-
| |
− | | rowspan="5" | '''Comparison Functions'''
| |
− | | align="center" | min(x,y) || Returns the minimum value of x and y.
| |
− | |-
| |
− | | align="center" | max(x,y) || Returns the maximum value of x and y.
| |
− | |-
| |
− | | align="center" | equal(x,y) || Returns 1 when x = y, 0 otherwise.
| |
− | |-
| |
− | | align="center" | below(x,y) || Returns 1 when x < y, 0 otherwise.
| |
− | |-
| |
− | | align="center" | above(x,y) || Returns 1 when x > y, 0 otherwise.
| |
− | |-
| |
− | | rowspan="4" | '''Formatting Functions'''
| |
− | | align="center" | int(x) || Returns the integer portion of x.
| |
− | |-
| |
− | | align="center" | frac(x) || Returns the fractional portion of x.
| |
− | |-
| |
− | | align="center" | round(x) || Returns x rounded to the nearest whole number.
| |
− | |-
| |
− | | align="center" | trunc(x,n) || Returns x truncated to n decimal places.
| |
− | |-
| |
− | | rowspan="6" | '''Trigonometric Functions'''
| |
− | | align="center" | atan(x) || Returns the arctangent of x.
| |
− | |-
| |
− | | align="center" | cos(x) || Returns the cosine of x.
| |
− | |-
| |
− | | align="center" | sin(x) || Returns the sine of x.
| |
− | |-
| |
− | | align="center" | tan(x) || Returns the tangent of x.
| |
− | |-
| |
− | | align="center" | abscos(x) || Returns the absolute value of cosine(x).
| |
− | |-
| |
− | | align="center" | abssin(x) || Returns the absolute value of sin(x).
| |
− | |}
| |
− | </blockquote>
| |
− | | |
− | The order of operator precedence is summarized as follows, from top to bottom:
| |
− | | |
− | <div style="margin-left: 20pt;"><table style="border-spacing:0px; border-collapse:collapse; background: #f9f9f9">
| |
− | <tr><td style="text-align:left; padding-right:20pt"><b>( )</b></td><td> </td></tr>
| |
− | <tr><td style="text-align:left; padding-right:20pt"><b> !</b></td><td> </td></tr>
| |
− | <tr><td style="text-align:left; padding-right:20pt"><b> ^</b></td><td> </td></tr>
| |
− | <tr><td style="text-align:left; padding-right:20pt"><b>* /</b></td><td>Left to right</td></tr>
| |
− | <tr><td style="text-align:left; padding-right:20pt"><b>+ -</b></td><td>Left to right</td></tr>
| |
− | <tr><td style="text-align:left; padding-right:20pt"><b><nowiki>|</nowiki> &</b></td><td>Left to right</td></tr>
| |
− | </table></div>
| |
− | | |
− | Variables may be assigned and used by specifying a simple string of letters. Examples: <span style="font-family: monospace,monospace; font-size:1em;">math(val=2)</span> or <span style="font-family: monospace,monospace; font-size:1em;">math(x=pow(2,3))</span>.
| |
− | | |
− | Multiple equations may be specified, each separated by a semicolon.
| |
− | Expressions are evaluated left to right.
| |
− | The final value of the [[#Math|Math()]] function will be the result of the right-most equation. For example, the equation <span style="font-family: monospace,monospace; font-size:1em;">math(x=4; pow(2^x))</span> will output 16.
| |
− | | |
− | <b>Note</b>: Empty fields
| |
− | | |
− | Fields used inside of [[#Math|Math()]] are expanded (interpolated) directly.
| |
− | Fields with empty values may produce incomplete [[#Math|Math()]] statements.
| |
− | For example, if the field [number plays] is empty, an <i>expression</i> such as <span style="font-family: monospace,monospace; font-size:1em;">math([number plays] + 2)</span> would be seen
| |
− | by [[#Math|Math()]] as <span style="font-family: monospace,monospace; font-size:1em;"> + 2</span>.
| |
− | This incomplete <i>expression</i> would produce a syntax error. See the Additional Examples for more information.
| |
− | | |
− | <b>Note</b>: Locales and Commas
| |
− | | |
− | Special care must be taken with the [[#Math|Math()]] function and locales that use <span style="font-family: monospace,monospace; font-size:1em;">,</span> (comma) as a decimal separator.
| |
− | Many Media Center fields and the return values from functions may contain comma as the decimal point.
| |
− | Your expressions will need to [[#Replace|Replace()]] these before passing the values to [[#Math|Math()]],
| |
− | which always uses dot <span style="font-family: monospace,monospace; font-size:1em;">.</span> as the numeric decimal point.
| |
− | | |
− | For example, the <i>expression</i> <span style="font-family: monospace,monospace; font-size:1em;">math(1,5 + 1,5)</span> will fail since [[#Math|Math()]] does not consider <span style="font-family: monospace,monospace; font-size:1em;">1,5</span> to be a valid number.
| |
− | | |
− | Fields that cause problems are any fields that produce floating-point values, such as any Date type field in raw format
| |
− | (e.g. <span style="font-family: monospace,monospace; font-size:1em;">[date,0]</span>, <span style="font-family: monospace,monospace; font-size:1em;">[last played,0]</span>, <span style="font-family: monospace,monospace; font-size:1em;">[date modified,0]</span>, and <span style="font-family: monospace,monospace; font-size:1em;">[date imported,0]</span>), or any textual field that contains
| |
− | floating-point values that will be used for various calculations (e.g. any of the Dynamic Range variants).
| |
− | Certain functions such as [[#Now|Now()]] and [[#ConvertTime|ConvertTime()]] also return localized floating-point values.
| |
− | | |
− | Handling this problem is not difficult.
| |
− | Before passing any floating point number to [[#Math|Math()]], use [[#Replace|Replace()]] first. See the examples below.
| |
− | |- valign="top"
| |
− | ! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 0px 1px 2px 2px; border-top: 1px solid #bbb; border-right: 1px solid #bbb;" | Examples
| |
− | |style="background: #f9f9f9; color: #111; border-style: solid; border-width: 0px 2px 2px 0; border-top: 1px solid #bbb;" | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math(10 + 4)</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">Returns 14.</p>
| |
− | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math(10 + 2 * 25)</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">Returns 60, demonstrating that multiplication has higher precedence than addition.</p>
| |
− | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math((10 + 2) * 25)</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">Returns 300, demonstrating that parenthesis grouping has higher precedence than multiplication.</p>
| |
− | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math(replace(now(), /,, .) - replace([last played,0], /,, .))</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">The <span style="font-family: monospace,monospace; font-size:1em;">,</span> is replaced by a <span style="font-family: monospace,monospace; font-size:1em;">.</span> in the output of both [[#Now|Now()]] and in the raw field value <span style="font-family: monospace,monospace; font-size:1em;">[last played,0]</span>.
| |
− | Note that the comma must be escaped so that it is seen as an argument and not as an argument separator.</p>
| |
− | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math(replace(now() - [last layed,0], /,, .))</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">The same as the previous example, but is more efficient and simpler since it calls [[#Replace|Replace()]] just once on the entire string to be passed to [[#Math|Math()]].</p>
| |
− | | |
− | Additional Examples
| |
− | | |
− | :[http://yabb.jriver.com/interact/index.php?topic=58110.0 An explanation and some solutions for fields that evaluate to empty within Math().]
| |
− | |}
| |
− | <div style="text-align:right;">([[#top|Back to top)]]</div>
| |
− | | |
− | === <span id="Number">Number(…)</span> ===
| |
− | : Returns the first number , including decimals, from a given string
| |
| | | |
| {{function description box | | {{function description box |
− | | name=Number | + | | name=Literal |
| | arguments=String | | | arguments=String |
| | description= | | | description= |
− | Returns the first number , including decimals, from a given string. If there are other numbers along the string, these will not be returned as the function stops once it encounters and returns the first number. <i>String</i> can be given literally, as a library field, or combined with other expression functions.
| + | [[#Literal|Literal()]] returns a given string as-is without any formatting or processing |
| | | |
| | examples= | | | examples= |
− | '''{{monospace|Number(The number12 will be returned, but 13 will not)}}''' | + | '''{{monospace|If(IsEqual([Artist], Queen, 1), Literal(If all music was Queen, I would be 10/10ths happy!), Literal(This is not Queen, which makes me sad. :-/))}}''' |
− | : This expression will return 12 and stop. It will not see the number 13. | + | : This does not work, with the sad face breaking the expression completely and generating an error. It should work, suggesting that the Literal() function is currently broken. |
| + | : This reference will be updated once clarification has been received. In the meantime, as detailed under [[Expression Language#Expression Language Syntax|Expression Language Syntax]], using /* ... /* does work as Literal() is expected to. See next example... |
| + | |
| + | '''{{monospace|/*Left(Theater,3) returns/* Left(Theater,3)}}''' |
| + | : Returns {{monospace|Left(Theater,3) returns The}}. Here, the first expression function is not evaluated and instead, presented as given, whilst the second function, which is not escaped, is evaluated. Escaping text in this way could be useful if working with a large block of text that might contain parenthesis, forward slashes or other characters that would otherwise require to be escaped individually. |
| }} | | }} |
| | | |
− | === <span id="Rand">Rand(…)</span> === | + | === <span id="Repeat">Repeat(…)</span> === |
− | : Returns a random number between two given numbers | + | : Repeats a given string a specified number of times |
| | | |
| {{function description box | | {{function description box |
− | | name=Rand | + | | name=Repeat |
− | | arguments=x, y, mode | + | | arguments=Value, Count |
| | description= | | | description= |
− | {{argument optional|Mode|0|}} | + | Repeats {{monospace|"Value", "Count"}} number of times. |
− | : '''x''' = start number (can be a negative value)
| |
− | : '''y''' = end number (can be a negative value)
| |
− | {{argument table
| |
− | | contents=
| |
− | {{argument table row|0|Returns a random value between x and y to 15 decimal places ''(Default mode)''}}
| |
− | {{argument table row|1|Returns a random value between x and y, whole numbers only.}}
| |
− | }}
| |
− | Rand() returns a random value between x and y. x and y must be numbers and can have negative values.
| |
− | | |
− | Rand() is not recommended for use in any context that continually refreshes its content, such as in a panes column, file list, or expression-based custom query. Probably the best way to understand the results is to test the first example below as an expression column in a file list, and move the mouse around over that column.
| |
− | | |
| | examples= | | | examples= |
− | '''{{monospace|Rand(0,1)}}''' | + | '''{{monospace|<nowiki>Repeat(*,10)</nowiki>}}''' |
− | : This will return a random value between 0 and 1, to fifteen decimal places. ''Mode'' has not been specified, and so defaults to zero. | + | : Returns ********** |
| | | |
− | '''{{monospace|Rand(-10,10,1)}}''' | + | '''{{monospace|<nowiki>Repeat(Ha,5)</nowiki>}}''' |
− | : ''Mode'' 1 has been specified, so this will return a random, whole number value between -10 and 10. | + | : Returns HaHaHaHaHa |
| }} | | }} |
− |
| |
− | === <span id="Range">Range(…)</span> ===
| |
− | : Creates a semi-colon delimited list of numbers in a field.
| |
− |
| |
− | {| style="width: 100%; border-spacing: 0; border: 0px solid black;" align="top" cellpadding="3" cellspacing="0"
| |
− | |- id="Range" valign="top"
| |
− | ! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 2px 1px 0 2px; border-right: 1px solid #bbb;" width="100" | Description
| |
− | | style="background: #f9f9f9; color: #111; border-style: solid; border-width: 2px 2px 0 0" width="1200" | <span style="font-family: monospace,monospace; font-size:1em; color:#0f3f8d; font-size:110%"><b>Range(</b><i>Start</i><b>, </b><i>Step</i><b>, </b><i>Count</i><b>)</b></span>
| |
− | The [[#Range|Range()]] function returns a list of semi-colon separated numbers into one field, starting at the <i>Start</i> number, incrementing by the <i>Step</i> number, producing <i>Count</i> numbers.
| |
− |
| |
− | Arguments <i>Start</i> and <i>Step</i> are optional (default to 0 Zero), and can be negative.
| |
− |
| |
− | Argument <i>Count</i> is required and must be positive.
| |
− |
| |
− | |- valign="top"
| |
− | ! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 0px 1px 2px 2px; border-top: 1px solid #bbb; border-right: 1px solid #bbb;" | Examples
| |
− | |style="background: #f9f9f9; color: #111; border-style: solid; border-width: 0px 2px 2px 0; border-top: 1px solid #bbb;" | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>Range(1, 1, 10)</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">Returns <span style="font-family: monospace,monospace; font-size:1em;">1;2;3;4;5;6;7;8;9;10</span>.</p>
| |
− | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>Range(5, -1, 6)</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">Returns <span style="font-family: monospace,monospace; font-size:1em;">5;4;3;2;1;0</span>.</p>
| |
− | |}
| |
− | <div style="text-align:right;">([[#top|Back to top)]]</div>
| |
| | | |
| === <span id="Row">Row(…)</span> === | | === <span id="Row">Row(…)</span> === |
Line 437: |
Line 220: |
| <div style="text-align:right;">([[#top|Back to top)]]</div> | | <div style="text-align:right;">([[#top|Back to top)]]</div> |
| | | |
− | === <span id="StackCount">StackCount(…)</span> === | + | === <span id="Translate">Translate(…)</span> === |
− | : Returns the number of files in a stack | + | : Converts an English string found in the program to the current language selected in the language menu |
| | | |
| {{function description box | | {{function description box |
− | | name=StackCount | + | | name=Translate |
− | | arguments= | + | | arguments=String |
| | description= | | | description= |
− | StackCount() does not require any arguments and is used to return the number files in a stack. This is useful, for example, if you are creating custom tooltips and want that information in there or for inclusion in a view you could create to view and manage your stacks, something you might use heavily if you stack a lot of photos or regularly sync files to a handheld device using the ''convert format'' options available there. Note that some files can appear in multiple databases.
| + | When using Media Center with any language ''other than English'', the Translate() function can be used to translate an English string in the program to the current language. |
| | | |
| | examples= | | | examples= |
− | '''{{monospace|<nowiki>StackCount()</nowiki>}}''' | + | '''{{monospace|<nowiki>Translate(Keywords)</nowiki>}}''' |
− | : Create a panes view where the "Set rules for file display" contains only ''-[Stack Top]=-1 ~d=mk'' and nothing else. Add categories to this view as suits, but, make the first one an expression category using the given example, and the second one, a simple expression ''=[stack top], which makes it possible to filter the file list by individual stacks selection. | + | : If using the French language setting, this will return Mots-clés |
− | '''<u>Important Note</u>'''<br>
| |
− | This should be considered an advanced user approach, where it is <u>''very''</u> important that you understand the differences in how Media Center behaves when stacks are either collapsed or expanded. [https://yabb.jriver.com/interact/index.php/topic,105662.0.html This forum post] should help in that regard.
| |
| }} | | }} |
| | | |
− | === <span id="TrackNumber">TrackNumber(…)</span> === | + | === <span id="TreeNode">TreeNode(…)</span> === |
− | : Returns a file's track # value. | + | : Returns the selected tree path. |
− | | |
− | {| style="width: 100%; border-spacing: 0; border: 0px solid black;" align="top" cellpadding="3" cellspacing="0"
| |
− | |- id="TrackNumber" valign="top"
| |
− | ! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 2px 1px 0 2px; border-right: 1px solid #bbb;" width="100" | Description
| |
− | | style="background: #f9f9f9; color: #111; border-style: solid; border-width: 2px 2px 0 0" width="1200" | <span style="font-family: monospace,monospace; font-size:1em; color:#0f3f8d; font-size:110%"><b>tracknumber(</b><b>)</b></span>
| |
− | The [[#TrackNumber|TrackNumber()]] function returns a file's track #, or 0 if the no value exists.
| |
− | It is used to populate the Library field <span style="font-family: monospace,monospace; font-size:1em;">track #</span> with its value.
| |
− | Either the field or [[#TrackNumber|TrackNumber()]] can be used.
| |
− | |- valign="top"
| |
− | ! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 0px 1px 2px 2px; border-top: 1px solid #bbb; border-right: 1px solid #bbb;" | Examples
| |
− | |style="background: #f9f9f9; color: #111; border-style: solid; border-width: 0px 2px 2px 0; border-top: 1px solid #bbb;" | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>tracknumber()</nowiki></b></span>
| |
− | <p style="margin-left:20pt;">Returns the value present in the <span style="font-family: monospace,monospace; font-size:1em;">track #</span> field.</p>
| |
− | |}
| |
− | <div style="text-align:right;">([[#top|Back to top)]]</div>
| |
− | | |
− | === <span id="Translate">Translate(…)</span> ===
| |
− | : Converts an English string found in the program to the current language selected in the language menu
| |
| | | |
| {{function description box | | {{function description box |
− | | name=Translate | + | | name=TreeNode |
− | | arguments=String | + | | arguments=Mode |
| | description= | | | description= |
− | When using Media Center with any language ''other than English'', the Translate() function can be used to translate an English string in the program to the current language.
| + | {{argument optional}} |
| + | {{argument table |
| + | | name=mode |
| + | | contents= |
| + | {{argument table row|0|Returns the full tree path}} |
| + | {{argument table row|1|Returns the currently selected tree node}} |
| + | {{argument table row|2|Returns the parent of the currently selected tree node}} |
| + | }} |
| | | |
| | examples= | | | examples= |
− | '''{{monospace|<nowiki>Translate(Keywords)</nowiki>}}''' | + | '''{{monospace|<nowiki>TreeNode()</nowiki>}}''' |
− | : If using the French language setting, this will return Mots-clés | + | : Will return the full tree path of the currently selected tree item (Uses mode zero by default) |
| + | |
| + | What this function does is self-explanatory. '''[https://yabb.jriver.com/interact/index.php/topic,128134.msg888957.html#msg888957 This conversation]''' on the Interact forums demonstrates a practical use-case scenario. |
| }} | | }} |
| | | |
The functions in this section are varied and have specialized applicability.
Some are primarily used internally by MC to generate values available in various Library fields.