QBasic 1.1: TYPE Statement

Syntax

TYPE usertype
 elementname AS typename
 [elementname AS typename]
.
.
.
END TYPE

Description / Parameter(s)

usertype The name of the data type being defined. The name can consist of up to 40 characters and must begin with a letter. Valid characters are A-Z, 0-9, and period (.).
elementname An element of the user-defined data type.
typename The element's type (INTEGER, LONG, SINGLE, DOUBLE, STRING, or a user-defined data type).
Use DIM, REDIM, COMMON, STATIC, or SHARED to create a variable of a user-defined data type.

Example

TYPE Card Suit AS STRING * 9 Value AS INTEGER END TYPE DIM Deck(1 TO 52) AS Card Deck(1).Suit = "Club" Deck(1).Value = 2 PRINT Deck(1).Suit, Deck(1).Value