CHAR(size)

The CHAR data type is a fixed-length character string data type.

Syntax

CHAR[ACTER] [ (size) ]
  1. size defines the maximum length of the character string. The upper limit is 65534.
  2. When size is not specified, the default length is 1.
  3. CHAR and CHARACTER are synonyms.

Usage

CHAR variables are initialized to NULL in functions, modules and globals.

The size can be expressed in bytes or characters, depending on the length semantics used in programs.

CHAR variables are always filled with trailing blanks, but the trailing blanks are not significant in comparisons.

MAIN
  DEFINE c CHAR(10)
  LET c = "abcdef"
  DISPLAY "[", c ,"]"      -- displays [abcdef    ]
  IF c == "abcdef" THEN    -- this is TRUE
     DISPLAY "equals"
  END IF
END MAIN