visual basic data type
' For VBA / VB / Visual Basic only
'EXAMPLE
Dim sStringVar as String
sStringVar = "What data-type am I being seen as?"
MsgBox(VarType(sStringVar)) ' This will give an output of: 8
'SYNTAX
' VarType(<variable-that-you-want-to-check-the-data-type-of>)
'NOTE: the date types are as follows:
+-------+----------------------+------------------------------------------------------------------------+
| VALUE | CONSTANT | DESCRIPTION |
+-------+----------------------+------------------------------------------------------------------------+
| 0 | vbEmpty | Empty (uninitialized) |
| 1 | vbNull | Null (no valid data) |
| 2 | vbInteger | Integer |
| 3 | vbLong | Long integer |
| 4 | vbSingle | Single-precision floating-point number |
| 5 | vbDouble | Double-precision floating-point number |
| 6 | vbCurrency | Currency value |
| 7 | vbDate | Date value |
| 8 | vbString | String |
| 9 | vbObject | Object |
| 10 | vbError | Error value |
| 11 | vbBoolean | Boolean value |
| 12 | vbVariant | Variant (used only with arrays of variants) |
| 13 | vbDataObject | A data access object |
| 14 | vbDecimal | Decimal value |
| 17 | vbByte | Byte value |
| 20 | vbLongLong | LongLong integer (valid on 64-bit platforms only) |
| 36 | vbUserDefinedType | Variants that contain user-defined types |
| 8192 | vbArray | Array (always added to another constant when returned by this function)|
+-------+----------------------+------------------------------------------------------------------------+
Are there any code examples left?
New code examples in category BASIC
-
BASIC 2022-03-27 17:45:10 JWT EM VBNET
-
BASIC 2022-03-20 07:40:02 get unique random number in vb.net
-
BASIC 2022-03-11 21:30:23 visual basic for loop
-
BASIC 2022-03-05 08:25:09 token em vbnet incluido no header da requisição
-
BASIC 2022-03-03 04:25:02 dos/cmd equivalent to "head"
-
BASIC 2022-02-26 20:20:04 mid visual basic function
-
BASIC 2022-02-23 02:15:02 vscode unindent
-
BASIC 2022-02-18 16:20:01 freecodecamp basic algorithm scripting return largest numbers in arrays
-
BASIC 2022-02-10 15:10:40 visual basic how to create a dynamic button
-
BASIC 2022-02-04 20:30:23 tmux basic commands