Object Model Reference : Classes : C : CorelScriptTools : Methods : CorelScriptTools.GetType |
Function GetType(Expression As Variant) As Long
Member of CorelScriptTools
The GetType method returns an expressions data type. In the case of variants, the data subtype is returned.
The GetType function returns one of the following values:
• |
0 = Empty variant
|
• |
2 = Boolean
|
• |
3 = Integer
|
• |
4 = Long
|
• |
5 = Single
|
• |
6 = Double
|
• |
7 = Date
|
• |
8 = Currency
|
• |
9 = String
|
In the following code example, A is assigned the value 2 because the variant Z data subtype is set to long.
x% = 66 'integer data type |
y# = 14 'long data type |
Z = x / y |
A = GETTYPE (x / y) |
In the following code example, B is set to 4 because a whole number is treated as a long and C is set to 6 because a fractional number is treated as a double.
B = GETTYPE (3) |
C = GETTYPE (3.3) |
Copyright 2013 Corel Corporation. All rights reserved.