Default Variable Typing

In most older versions of BASIC (including PowerBASIC for DOS), all variables without a TypeID (%, !, &, etc.) are automatically considered to be single precision floating point.  Other compilers have chosen other defaults (for example, VB defaults to Variant).

To avoid this ambiguity, PowerBASIC asks you to make this determination instead.  You can use the DEF statement to specify your preferred default variable type to be applied to untyped variable names.  For example, to mimic the single precision default of PB/DOS, simply add a DEFSNG statement to the top of your program:

DEFSNG A-Z

 

See Also

Variables

Variable Scope