Previous Next


                                               53
      SECTION 3.2                                                                  Objects



      Throughout this book, the term number refers to an object whose type may be
      either integer or real. Wherever a real number is expected, an integer may be used
      instead and is automatically converted to an equivalent real value. For example, it
      is not necessary to write the number 1.0 in real format; the integer 1 is sufficient.

3.2.3 String Objects

      A string object consists of a series of bytes—unsigned integer values in the range 0
      to 255. String objects are not integer objects, but are stored in a more compact
      format. The length of a string may be subject to implementation limits; see
      Appendix C.

      String objects can be written in two ways:

      • As a sequence of literal characters enclosed in parentheses ( ); see “Literal
        Strings,” below”
      • As hexadecimal data enclosed in angle brackets < >; see “Hexadecimal Strings”
        on page 56

      This section describes only the basic syntax for writing a string as a sequence of
      bytes. Strings can be used for many purposes and can be formatted in a variety of
      ways. When a string is used for a specific purpose (to represent a date, for ex-
      ample), it is useful to have a standard format for that purpose (see Section 3.8.3,
      “Dates”). Such formats are merely conventions for interpreting the contents of a
      string and are not separate object types. The use of a particular format is
      described with the definition of the string object that uses that format.

      Section 3.8.1, “String Types” describes the encoding schemes used for the
      contents of string objects.


      Literal Strings

      A literal string is written as an arbitrary number of characters enclosed in
      parentheses. Any characters may appear in a string except unbalanced
      parentheses and the backslash, which must be treated specially. Balanced pairs of
      parentheses within a string require no special treatment.

Previous Next