qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
User-Defined Data Types
  Data Types   User-Defined Data Types   Contents   Index
──────────────────────────────────────────────────────────────────────────────
User-Defined Data Types
 
BASIC lets you define new data types using the TYPE statement. A user-
defined type is an aggregate type made up of elementary BASIC types. For
example, the following TYPE statement defines a type, SymTabEntry:
 
  TYPE SymTabEntry
    Identifier AS STRING * 40
    LineNumber AS LONG
    Value      AS LONG
  END TYPE
 
The new type contains a fixed-length string and two long integers. A
variable of a user-defined type occupies only as much storage as the sum of
its components. A SymTabEntry takes up 48 bytes: 40 bytes for the fixed-
length string and 4 bytes each for the two long integers.
 
You may use any of the basic data types (except variable-length strings) in
a user-defined type: short and long integers, single- and double-precision
floating-point values, and fixed-length strings.
 
  Note: User-defined types cannot include arrays or variable-length
        strings.