User Tools

Site Tools


Sidebar

Passage markup

basics

coding

extra

list

section

whitespace

Macros

basics

colour

data structure

date and time

game state

live

maths

number

revision

saving

showing and hiding

string

styling

url

deprecated

Types of data

Special keywords

Special passage tags

harlowe:str-repeated

(str-repeated: Number, String) → String

Also known as: (string-repeated:)

A special shorthand combination of the (str:) and (repeated:) macros, this accepts a single string and duplicates it the given number of times.

Example usage:

  • (str-repeated: 5, "Fool! ") produces "Fool! Fool! Fool! Fool! Fool! "

Rationale:

This macro is a shorthand form of nesting (repeated:) inside (str:). This example: (str: ...(repeated: 14, "-+*+")) is the same as (str-repeated: 14, "-+*+").

Details:

An error will, of course, be produced if the number given is 0 or less, or contains a fraction.

See also:

harlowe/str-repeated.txt · Last modified: 2019/04/16 03:14 by l