Section Variables


Measures and meters can be referenced as variables. These are called section variables, and they can provide several kinds of information about the meter or measure.

Usage

A meter or measure is referenced as a section variable by placing the section name in brackets []. Numeric values provided by a section variable can be modified by adding parameters after a colon :. Multiple parameters are separated by commas ,.

[SectionName:P1,P2]

Note: Normal or built-in variables take priority over section variables, which means that while they can be used within section variables, for example: [#Foo#:#Bar#], the reverse, such as #[Foo][Bar]#, is not valid.

This limitation can be addressed by using the Nesting Variables form of the variables.

Example: [#[&Foo][&Bar]]

Dynamic Variables

Section variables are always dynamic. DynamicVariables=1 will always be needed on a measure or meter section where the variable is used in an option value.

Meter Parameters

None

Section variables for meters have no value without a parameter.

:X, :YExample: [MeterName:X]

The current X or Y position of the meter.

Notes: This provides the "real" X or Y value, which is the position of the top-left corner of the meter area. This is always an integer, even if the meter has no X and Y options set, or if the options use formulas, variables or relative positions.

The values for X or Y may be different than the values in the meter options if StringAlign is used on a String meter.

:W, :HExample: [MeterName:W]

The current width or height of the meter.

Notes: This provides the "real" W or H value. This is always an integer, even if the meter has no W and H options set, or if the options use formulas or variables.

The values for W or H may be different than the values in the meter options if Padding is used.

:XW, :YHExample: [MeterName:XW]

The current X or Y position and W or H width or height of the meter added together. This will provide the current position of the end of the meter in the X+width or Y+height dimension.

This equates to, and can be used in place of, X=([SomeMeter:X] + [SomeMeter:W]) or Y=([SomeMeter:Y] + [SomeMeter:H]) to position a meter relative to the end of another meter.

Notes:

This uses the "real" X/Y/W/H values. This is always an integer, even if the meter has no X and Y options or W and H options set, or if the options use formulas or variables.

The values for X or Y may be different than the values in the meter options if StringAlign is used on a String meter.

The values for W or H may be different than the values in the meter options if Padding is used.

Measure Parameters

NoneExample: [MeasureName]

If no parameters are given, the measure's string value is provided.

:Example: [MeasureName:]

If a blank parameter is given, the measure's number value is provided, with up to ten decimal places of precision.

:nExample: [MeasureName:4]

The measure's number value, with the number of decimal places given.

Multiple Parameters: This parameter may be combined with Scale and Percentual.

Example: [MeasureName:/1024,4]

Example: [MeasureName:%,4]

:/nExample: [MeasureName:/1024]

The measure's number value, scaled by the divisor given.

Multiple Parameters: This parameter may be combined with Decimals and Percentual.

Note: The divisor must be an integer value.

Example: [MeasureName:/1024,4]

Example: [MeasureName:/1024,4,%]

:%Example: [MeasureName:%]

The measure's number value, as a percentual value.

Multiple Parameters: This parameter may be combined with Decimals and Scale.

Example: [MeasureName:%,4]

Example: [MeasureName:/1024,%]

Example: [MeasureName:/1024,4,%]

:MinValue, :MaxValueExample: [MeasureName:MaxValue]

The measure's MinValue or MaxValue number value.

:EscapeRegExpExample: [MeasureName:EscapeRegExp]

The measure's string value will be treated as a PCRE Regular Expression pattern, and all regular expression reserved characters, which are .^$*+?()[{\|, will be "escaped" with \.

:EncodeURLExample: [MeasureName:EncodeURL]

The measure's string value will be URL-Encoded, also known as Percent Encoded.

This can be used to create a URL option for WebParser where there are "input" parts of the URL, such as: https://somesite.com?search=I live in München where both the spaces, and the ü character are not allowed in a URL. You would want to encode I live in München as I%20live%20in%20M%C3%BCnchen.


All characters except ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~ will be encoded in the string. Those are considered to be the standard URL-safe characters.


Do NOT encode the entire URL, since URLs contain specific characters that are used as delimiters and should not be encoded. These delimiters include: :/?#[]@!$&'()*+,;=.

It is recommended to only encode specific query portions of the URL after the protocol://host/path/.
Example: URL=https://somesite.com?search=[&MeasureName:EncodeURL]


Note: The URL option of WebParser will automatically do much of this encoding when the URL is sent, so it might be rare that you need this parameter. it will be needed if you think the "input" part of your URL might contain text with literal :/?#[]@!$&'()*+,;= characters, which WebParser will always treat as delimiter or anchor characters, and will never encode.

:TimestampExample: [MeasureName:Timestamp]

This will only return a value when used with a Time measure. The measure's Windows timestamp value. This will allow you to obtain the numeric value of the Windows timestamp from a Time measure that has a Format option, and won't have the timestamp as the normal number value.