String Basics

A string is a collection of text characters that is most commonly used to get information from a user and to display text on a screen. ViviFire code can contain string literals and string variables.

String literals

A string literal is a representation of a string value written in code. ViviFire's string literals can represent both printable and nonprintable characters.

A basic string literal can contain any printable characters by enclosing them in double quotation marks ("). Here is an example:

"This is a basic string literal."

Multi-line strings

Sometimes a string literal can become quite long—so long it goes off the screen and you have to scroll horizontally, something many people find awkward. One fix would be to break the literals into smaller strings and concatenate then together at run-time. That would work well enough if it needed to be done just once or a few times, but if it needs to happen more frequently, the concatenations would contribute to slow down the application.

ViviFire solves these problems by allowing a string literal to span multiple lines.

"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
A decimal (base-10) integer.
A binary (base-2) integer.
A hexadecimal (base-16) integer.
An octal (base-8) integer.
An abbreviation for a commonly used string.

For a list, see Pre-calculated Constants.

Mixing string constants and string literals


String variables