Expressions

Main Menu
Get Item Value
Get Item String
Get X Position
Get Y Position
Get Ini as String
Get Ini as CSV String

Current Group

List Groups and Items
Get N-th Group Name
Get N-th Item Name
Get N-th Item String
Get N-th Item Value
Get N-th Sorted Item Name
Get N-th Sorted Item Value
Get N-th Item used in any group

Counting and Calculations
Get Group Count
Get Item Count
Get Total Item Count
Get number of unique item names
Perform Calculations
Find Max or Min Group

Search Results
Number of Search Results
Get N-th Search Result Group
Get N-th Search Result Item Name
Get N-th Search Result Item Value
Get N-th Search Result Item String
Get N-th Search Result Path

Extra Functions
Hash String
Escape String
Unescape String


Main Menu

Get Item Value

Gets the value corresponding to a particular item as a number. This number will be an integer if it can be, but otherwise a floating point number. The first parameter is the group name, the second parameter is the item name and the final parameter is the default value.

In the event that the item does not exist, the default value is used. The default value is always returned as a float.

Get Item String

Gets the value corresponding to a particular item as a string. The first parameter is the group name, the second is the item name and the final parameter is the default value. In the case that the item does not exist, the default value is used.

The string might not be returned in exactly the same manor that it is scored in the file. For instance, escape characters will be replaced with the characters they represent and quotes may be removed.

Get X Position

The first and second parameters determine the group and item to read respectively. This expression applies to items formatted in the manor “number1, number2”. This expression returns, as an integer, ‘number1’. If it does not exist, a default value of 0 is used.

Get Y Position

The first and second parameters determine the group and item to read respectively. This expression applies to items formatted in the manor “number1, number2”. This expression returns, as an integer, ‘number2’. If it does not exist, a default value of 0 is used.

Get Ini as String

TThis action receives as a string the text which would be saved to file by the ‘Save’ command. Encryption and compression is not applied, however.

Get Ini as CSV String

This action receives as a string the text which would be saved to file by the ‘Import/Export as CSV’ command.

top

Current Group

The expressions in this section are similar to those listed above, but apply only to the current group.

top

List Groups and Items

Get N-th Group Name

This expression lists all the group names in the object in alphabetical order. The parameter is which number group is to be returned. The first group is either 0 or 1 depending on the settings in the property pane.

Use the ‘Get Group Count’ expression to find out how many groups there are. Any value of range will just return a blank string.

Get N-th Item Name

This expression lists all the item names in the object in alphabetical order. The first parameter specifies the group to look in and the second parameter is which number item is to be returned. The first item is either 0 or 1 depending on the settings in the property pane.

Use the ‘Get Item Count’ expression to find out how many items there are in a particular group. Any value of range will just return a blank string.

Get N-th Item String

This expression gives the value associated with the n-th item in a list, by the ordering of th ‘Get N-th Item name’ expression (which orders by key name alphabetically).

The first parameter specifies the group to look in and the second parameter is which number item is to be returned. The first item is either 0 or 1 depending on the settings in the property pane.

Get N-th Item Value

This expression gives the value associated with the n-th item in a list, by the ordering of th ‘Get N-th Item name’ expression (which orders by key name alphabetically). The value is converting to a number (integer if possible, otherwise floating point).

The first parameter specifies the group to look in and the second parameter is which number item is to be returned. The first item is either 0 or 1 depending on the settings in the property pane.

Get N-th Sorted Item Name

This action is as ‘Get N-th Item name’, but the ordering is alphabetical on the values, not on the item names.

The first parameter specifies the group to look in and the second parameter is which number item is to be returned. The first item is either 0 or 1 depending on the settings in the property pane.

Use the ‘Get Item Count’ expression to find out how many items there are in a particular group. Any value of range will just return a blank string.

Get N-th Sorted Item Value

This action is as ‘Get N-th Item value’, but the ordering is alphabetical on the values, not on the item names. The value is returned as an integer if possible but a floating point otherwise.

The first parameter specifies the group to look in and the second parameter is which number item is to be returned. The first item is either 0 or 1 depending on the settings in the property pane.

Use the ‘Get Item Count’ expression to find out how many items there are in a particular group. Any value of range will just return a blank string.

Get N-th Item used in any group

This expression allows all items to be iterated through, regardless of group. It returns the item names. Items are not repeated.

For instance, the Ini file:

Example Ini 23

[group]
Bob = 1
Ted = 2
[group 2]
Bob = 12
John = 22

Then the list would be: ‘Bob’, ‘Ted’, ‘John’.

The ‘Get number of unique item names’ expression can be used to find out how many item names there are. This expression respects the ‘1 based index’ option. A blank string is returned out of range.

top

Counting and Calculations

Get Group Count

Returns the number of groups in the object. This includes empty groups if ‘Allow empty groups’ is enabled.

Get Item Count

Returns the number of items in the specified group.

Get Total Item Count

Returns the total number of items in any group (including items with the same name but in different groups).

Get number of unique item names

Returns the number of unique item names in the object. Useful with the ‘Get N-th Item used in any group’ expression.

Perform Calculations

This expression is a bit more complicated than the others.

The idea of the expression is to get data from the object by performing a calculation on each group, and then performing a calculation to combine all these numbers. For instance, we might find the average of every group and then take the product of all those averages. (Why you might want to do that is not obvious, but you can if you wish!)

It is best shown by examples.

For instance, suppose you had the following file (of Arsenal’s record against various teams since the war):

Example Ini 24

[Bradford City]
Win=10
Draw=5
Lose=9

[Ajax]
Win=1
Draw=0
Lose=3

[Barcelona]
Win=0
Draw=1
Lose=4

[Wimbledon]
Win=13
Draw=8
Lost=7

Suppose we wish to know how many matches there have been in total against these sides. This is easy with this expression. Setting the second parameter to ‘+’ will cause each group to be added up. Then we have the following values associated with each group: Bradford City, 24; Ajax: 4; Barcelona: 5; Wimbledon: 28. We obviously wish these values to be added up, so for the first parameter we choose ‘+’ and then the expression returns 24+4+5+28 = 61.

Now instead, suppose we wish to know the total number of games draw against each of these teams. To do that we just want to pick out the draws, so for the second parameter we just write ‘Draw’. We then have the following values associated with each group: Bradford City, 5; Ajax: 0; Barcelona: 1; Wimbledon: 8. For the first parameter we write ‘+’ again, and so the expression returns 14.

If you just wanted to sum the number of games against Ajax, you can write ‘Ajax’ for the first parameter and ‘+’ for the second parameter. It will then return 4.

The full table of operators are:

+
*
avg or ~
Min or \
Max or /
n
iavg
Group name
Item name
Sum
Product
Average
Minimum
Maximum
Number of items in the group (for second parameter only)
 Sums and then divides by the total number of items (for first parameter only)
 Receives the value associated with the group of this name (for first parameter only)
 Associates with the group the value of the item with this name (for second parameter only)

The following are some general examples:

Find Max or Min Group

This expression works very similarly to “Perform Calculations”. The items in each group are combined according to the second parameter, which may be any of the operators which were valid for the “Perform Calculations” expression. However, instead of combining these group values together, this expression returns the name of the group associated with either the maximum or minimum value. Therefore the first parameter may be only ‘Max’ or ‘Min’.

In the example from the “Perform Calculations” section, we could use this expression with first parameter ‘Max’ and second parameter ‘Win’ to find out the name of the team Arsenal had beaten the most (Wimbledon).

top

Search Results

Number of Search Results

This expression returns the number of search results.

Get N-th Search Result Group

This expression returns the group name of the nth search result.

Get N-th Search Result Item Name

This expression returns the item name of the nth search result.

Get N-th Search Result Item Value

This expression returns the value of the nth search result, converted to a number.

IGet N-th Search Result Item String

This expression returns the value of the nth search result.

Get N-th Search Result Path

This expression returns a string which is the group name, followed by the separator character, followed by the item name.

top

Extra Functions

Hash String

Returns the hash of the specified string.

Escape String

This expression replaces ‘\’ with ‘\\’, quotes with ‘\q’, tabs with ‘\t’ and newlines with ‘\n’. Newlines are whatever the new line character is in the object settings.

Unescape String

This expression replaces ‘\\’ with ‘\’, ‘\q’ with quotes, ‘\t’ with tabs, ‘\n’ with newlines and ‘\ ’ with spaces.

top