Skip to content
Duy Dao edited this page May 8, 2016 · 6 revisions

The range command can help us to generate number ranges.

Syntax

range START END STEP PADDING

Arguments

  • START (required) the starting number for this number range
  • END (optional) the last number of this number range. This value will be included in the list.
  • STEP (optional) the value to add to START for each selection. The default is 1.
  • PADDING (optional) the padding of the number. Leading zeroes will be added if the number of digits are smaller then this value. The default is 1.

All arguments can be negative as well.

Generate a number range for multiple selections:

We have three selections like in this setup:

<p>|</p>
<p>|</p>
<p>|</p>

Now, let's open the text pastry command line and enter this command:

range 5 10

We will get this result:

<p>5</p>
<p>6</p>
<p>7</p>

Generate numbers

The range command will behave differently when we have a single selection. To generate numbers, we make sure that we have only one selection:

# Numbers from 27 to 62
|

Now we can open the Text Pastry command line and enter this command:

range 27 62

We will get this result:

# Numbers from 27 to 62
27
28
29
...
60
61
62