bas7advr.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.
DEFtype Statement Details
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
DEFtype sets the default data type for variables, DEF FN functions, and
FUNCTION procedures.
 
DEFINT letterrange [,letterrange]...
DEFLNG letterrange [,letterrange]...
DEFSNG letterrange [,letterrange]...
DEFDBL letterrange [,letterrange]...
DEFCUR letterrange [,letterrange]...
DEFSTR letterrange [,letterrange]...
 
    ■ The argument letterrange has the syntax:
 
      letter1[-letter2]    letter1 and letter2 are any of the uppercase or
                           lowercase letters of the alphabet.
 
Usage Notes
    ■ DEFtype sets the default data type. For example, in the following
      program fragment, Message is a string variable:
 
         DEFSTR A-Q
         .
         .
         .
         Message="Out of stack space."
 
    ■ The case of the letters in letterrange is not significant. These
      three statements are equivalent:
 
        DEFINT I-N
        DEFINT i-n
        DEFINT i-N
 
    ■ A type-declaration character (%, &, !, #, @ or $) always takes
      precedence over a DEFtype statement. DEFtype statements do not affect
      record elements.
 
Important
    ■ I%, I&, I!, I#, I@, and I$, all are distinct variables, and each
      may hold a different value.
 
Differences from BASICA
    ■ BASICA handles default data types differently. BASICA scans each
      statement before executing it. If the statement contains a
      variable without an explicit type (indicated by %, &, !, #, @ or $),
      the interpreter uses the current default type.  In contrast, the
      current version of BASIC scans the text once only and after a
      variable appears in a program line, its type cannot be changed.