world.FixupEscapeSequences

MUSHclient script function (Method)

Converts "escape sequences" like \t to their equivalent codes.

Prototype

BSTR FixupEscapeSequences(BSTR Source);

Data type meanings

Description

This provides a script interface to the internal routine used by MUSHclient to convert special "escape" sequences into the ASCII equivalents.

The following sequences are recognised:

\a Bell (alert)
\b Backspace
\f Formfeed
\n New line
\r Carriage return
\t Horizontal tab
\v Vertical tab
\' Single quotation mark
\" Double quotation mark
\\ Backslash
\? Literal question mark
\xhh ASCII character in hexadecimal notation

VBscript example

world.send world.FixupEscapeSequences ("go north \n go west")

Jscript example

world.Send(world.FixupEscapeSequences(mystring));

// In JScript a quoted sequence like "\n" will already 
// be interpreted by the JScript interpreter

PerlScript example

$world->Send($world->FixupEscapeSequences($mystring));

// In PerlScript a quoted sequence like "\n" will already
// be interpreted by the PerlScript interpreter

Python example

world.Send(world.FixupEscapeSequences(mystring))

Lua example

Send(FixupEscapeSequences(mystring))

-- In Lua a quoted sequence like "\n" will already 
-- be interpreted by the Lua interpreter

Return value

The source string with any escape sequences (as described above) replaced by the equivalent code.

Related topic

Utilities

See also

FunctionDescription
FixupHTMLFixes up text for writing as HTML
ReplaceReplaces one substring with another
TrimTrims leading and trailing spaces from a string