String Basics

A string is a sequence of text characters that is frequently used to get information from a user and to show text on a screen. ViviFire code can contain string literals, string constants, and string variables.

String literals

A string literal is a indication of a string value written in code. ViviFire's string literals can show most characters.

A basic string literal contains printable characters between double quotation marks ("). Here is an example:

"This is a basic string literal."

Multi-line strings

A string literal can become long. It can become too long to read easily if you must scroll horizontally. One solution is to divide the string into many smaller strings and concatenate them at runtime. If this code executes a small number of times, then this could be a good solution. But, if this code must execute frequently, then it could make your program slower.

ViviFire lets you write one string literal on many lines. You write an underscore (_) after the first line. All lines between the first and last have one underscore before and one underscore after. Then the last line starts with an underscore. An example follows.

quote =
    "The following two statements are usually both true: "_
    _"There's not enough documentation. "_
    _"There's too much documentation. "_
    _"-- Larry Wall"

String constants

One of these
$ decimal
$B binary
$H hexadecimal
$O octal
$ name
decimal
A decimal (base-10) integer.
binary
A binary (base-2) integer.
hexadecimal
A hexadecimal (base-16) integer.
octal
An octal (base-8) integer.
name
An abbreviation for a frequently used string.

For a list, see Pre-Calculated Constants.

Mixtures of string constants and string literals

TODO

String variables

TODO