DefVar Statement

Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.

Syntax:

DefType statements diagram


    {DefBool|DefCur|DefDate|DefDbl|DefErr|DefInt|DefLng|DefObj|DefStr|DefSng|DefVar} {char|char-char}[,...]
  

Parameters:

char: Letter prefix that specifies default data type for variables.

char-char: Letter range prefixes that specify default data type for variables.

Example:


    ' Prefix definitions for variable types:
    DefBool b
    DefCur c,l-m
    DefDate t
    DefDbl f
    DefErr e
    DefInt i-k,N
    DefLng x-z, D
    DefObj U, o-R
    DefSng w,a
    DefStr s
    DefVar V,g

  Sub ExampleDefVar
      vDiv=99 REM vDiv is an implicit variant
      values="Hello world"
      Print Typename(glob), VarType(values), IsEmpty(vOffer) ' Displays: Empty 8 True
  End Sub

Please support us!