Value ranges

Table of contents


What are ranges

Quite often, when setting up a project, you will come across places where you need to specify a match number during search, line number, cell number, etc. Moreover, not always in such cases, you can specify a specific number. Ranges will help you set up more flexible numbering of such enumerations.

The following will be examples for the list, but remember that these examples are applicable for all cases where a number needs to be specified.


When do ranges apply:

  • You need to take the line spacing. For example, from the fifth to the seventh, etc .;

  • You need to take the last line without knowing the total number of lines;

  • You need to take a random line;

  • You need to take a few random lines;

  • You need to take several random lines from the specified interval;

  • You need to take even/odd lines from the specified interval;

  • You need to take random lines from even/odd lines from the specified interval.

  • Ranges can also be used as a match number when executing actions.
    Rise event, Setting values, Getting values


Take lines from one or more intervals

If you need to take lines from the fifth to the seventh, for example, then it is written in the line number like this:

4-6 (1 less since line numbering starts from 0).

You can specify multiple intervals separated by the ' ; 'or' , ': for example, 10-15; 7; 22-34


Take random element

There are situations when there are several identical elements on the page and you need to interact with any of them, no matter which one.

For example, when registering, you must specify the operating system and you are given a choice of several options. To click on a random one, you must specify the word random as the match number


The length of the list is unknown, but you need to take it to the end

The end of the list is indicated by the end keyword.

Just write an interval, for example: 10-end and it will take lines from 11 to the end of the file.


Take all lines from the list

You can take all lines by specifying the line number all .


Take a random line or multiple random lines from an interval

To do this, write the word random in the line number, then how many lines you need, then, in parentheses, from which lines to take.

For example:

random1(1.12-15.35-end) - to take one line from the specified ones,

or

random15(1.12-15.35-end) - to take 15 lines from the specified ones,

or

randomAll(1.12-15.35-end) - to take all lines from the specified ones in random order (randomAll is available in ZennoPoster version above 5.9.3).


Excluding ranges

Sometimes you want to ignore the latter options.

For example, you need to exclude the last 5 lines and take 1 random element, it will look like this:

random1(0-(end-5))

Exclusion ranges are available in ZennoPoster version 5.9.3 and higher.


Getting only even values

To get the first even value in a range, write:

even (1.12-15.35-end) or even1 (1.12-15.35-end)

To get the first 5 even values from the range, write:

even5(1,12-15,35-end)

To get all even values from a range, write:

evenAll(1,12-15,35-end)

The even operator is available in ZennoPoster version 5.9.3 and higher.


Getting only odd values

To get the first odd value from a range, write:

odd(1.12-15.35-end) or odd1(1.12-15.35-end)

To get the first 5 odd values from the range, write:

odd5(1,12-15,35-end)

To get all even values from a range, write:

oddAll(1,12-15,35-end)

The odd operator is available in ZennoPoster version 5.9.3 and higher.


Combining operators

The random, even, odd operators can be combined.

For example, to take all even lines in a random order from a range, you would write:

randomAll(evenAll(1,12-15,35-end))

Operator combination is available in ZennoPoster version 5.9.3 and higher.