Text is a built-in type in RESOLVE/C++, which is
included when you bring "RESOLVE_Foundation.h" into the global context. The name
Text is, therefore, unusual: It is the name of a
concrete instance even though it does not end in "_2" or "_1a" or the like.
RESOLVE/C++ (through the RESOLVE Foundation) includes Boolean
, Character,
Integer, and Real
as built-in scalar types. An object of any of these types has a very simple mathematical model: a
simple mathematical type boolean, character, integer, and real, respectively. While
Boolean, Integer
, and Real objects clearly are useful in a variety of
situations, Character objects usually seem less
valuable. The reason is that normally you want to combine individual
Character objects into strings (sequences). If you need to deal with a sequence of characters
as a unit, then you should use a Text object, whose
mathematical model is a string of characters.
RESOLVE/C++ has literals (constants) of the built-in types Boolean
, Character,
Integer, and Real
e.g., true, 'a', 13, and 3.14159, respectively. There also are literals of type
Text, e.g., "hello there ". A
Text literal comprises zero or more
Character literals enclosed in double-quotes, without single-quotes
around the individual Character literals that make it
up. You may use a Text literal any place a
Text object is required as an argument to an
operation if the associated formal parameter has preserves mode. This makes
Text a very useful type when you need to prompt a user for input,
label an output, construct a menu of choices, etc. Such prompts and labels may be
Text literals in your source code.1
Abstract Components
Concrete Components
To bring this component into the context you write:
#include "RESOLVE_Foundation.h"

1. For flexibility, you might store such Text literals in “resource files”. This allows a knowledgeable user to customize certain aspects of an application program (e.g., to adapt it to a foreign language) without having access to the source code. Resource files are not further discussed here, but they are conventional features of programs written for many systems, e.g., Macintosh or MS Windows.