Syntax
| Def{Bool|Cur|Date|Dbl|Int|Lng|Obj|Sng|Str|Var} letterrange[, ...]
| ||||
---|---|---|---|---|---|
Description
| Define untyped variables as:
• DefBool - Boolean
• DefByte - Byte
• DefCur - Currency
• DefDate - Date
• DefDbl - Double
• DefInt - Integer
• DefLng - Long
• DefObj - Object
• DefSng - Single
• DefStr - String
• DefVar - Variant
| ||||
See Also
| Option Explicit.
| ||||
Example
| DefInt A,C-W,Y' integer
DefBool B ' boolean
DefStr X ' string
' all others are variant
Sub Main
B = 1 ' B is an boolean
Debug.Print B ' True
X = "A" ' X is a string
Debug.Print X '"A"
Z = 1 ' Z is a variant (anything)
Debug.Print Z ' 1
Z = "Z"
Debug.Print Z '"Z"
End Sub
|