Previous Document Next Document

Object Model Reference : Classes : C : CorelScriptTools : Methods : CorelScriptTools.GetType


CorelScriptTools.GetType

Function GetType(Expression As Variant) As Long

Description

Member of CorelScriptTools

The GetType method returns an expression’s data type. In the case of variants, the data subtype is returned.

Parameter
Description
Expression
Specifies the expression to use

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
Example 1

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)
Example 2

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)

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.