FANDOM


BYOND Environment This page contains an entry from the official DM Reference.

Text consists of a string of characters enclosed in double quotes. To place a quote inside a string, escape it with \.

ExampleEdit

usr << "He said, \"Hi.\""

This example sends some text to the usr: He said, "Hi."

Embedded text expressionsEdit

To insert a variable expression into a string, enclose it in brackets []. These are referred to as embedded text expressions. An object expression will display the object's name preceded by the text macro \the or \The if no other article has been specified. Capitalization of the article is inferred from context.

ExampleEdit

mob/verb/shout(T as text)
  world << "[usr]: [T]"

If this example is called by a mob named "Bill" with the text "hi everybody!", it will display "Bill: hi everybody!".

On the other hand, if it is called by a mob named "cat", it would display "The cat: hi everybody!".

Text document syntaxEdit

For lengthy text strings, DM provides a special text document syntax. This begins with {" and ends with "}. It may include multiple lines and even un-escaped double quotes.

ExampleEdit

mob/verb/end()
  usr << {"
This is the way the world ends
This is the way the world ends
This is the way the world ends
Not with a bang but a whimper.

--T.S. Eliot "Hollow Men"
"}
  del world  //the end!

See alsoEdit