Back to Notenik Docs


The Notenik Knowledge Base

12.3 Variable Modifiers ↑

12.3.41 Repeat - ^R

This variable modifier makes use of the ‘^’ key to shift Notenik into a different set of functions to be performed by the following letters.

When the letter ‘R’ follows this shift character, it will engage the Repeat function, which will repeat a given string x number of times, with the variable being modified supplying the starting value for x.

Two integer values may optionally be specified before the start of the string to be repeated.

The first integer, which may be positive or negative, specifies a value to be added to the initial starting value supplied by the variable. It should be followed by a comma as a delimiter. If unspecified, this value will default to zero.

The second integer will act as a multiplier. This too should be followed by a comma to act as a delimiter. If unspecified, this value will default to 1.

The string following these first two values (up to the end of the variable, or to the next Shift character of ‘^’) will be repeated x number of times, where the variable itself provides the starting value of x.

The following example may be helpful.

=$level&^r-1,2, ^$=

In this example, a non-breaking space](https://www.freecodecamp.org/news/html-space-how-to-add-a-non-breaking-space-with-the-nbsp-character-entity/) will be repeated x times, with the Level variable supplying the starting value for x.

The first integer supplied is ‘-1’, which means that a value of 1 will be subtracted from the level field.

The second integer supplied is ‘2’, which means that the adjusted level field will be multiplied by two.

The effect will be to indent the following content based on the depth of the level field, with a level of 1 producing no indentation, and with two non-breaking spaces being used for indentation for each higher level value.


Next: 12.3.42 Formatting String